亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? os_time.c

?? ARM7Proteus.rar
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2002, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File : OS_TIME.C
* By   : Jean J. Labrosse
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#include "includes.h"
#endif

/*
*********************************************************************************************************
*                                DELAY TASK 'n' TICKS   (n from 0 to 65535)
*
* Description: This function is called to delay execution of the currently running task until the
*              specified number of system ticks expires.  This, of course, directly equates to delaying
*              the current task for some time to expire.  No delay will result If the specified delay is
*              0.  If the specified delay is greater than 0 then, a context switch will result.
*
* Arguments  : ticks     is the time delay that the task will be suspended in number of clock 'ticks'.
*                        Note that by specifying 0, the task will not be delayed.
*
* Returns    : none
*********************************************************************************************************
*/

void  OSTimeDly (INT16U ticks)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    


    if (ticks > 0) {                                                      /* 0 means no delay!         */
        OS_ENTER_CRITICAL();
        if ((OSRdyTbl[OSTCBCur->OSTCBY] &= ~OSTCBCur->OSTCBBitX) == 0) {  /* Delay current task        */
            OSRdyGrp &= ~OSTCBCur->OSTCBBitY;
        }
        OSTCBCur->OSTCBDly = ticks;                                       /* Load ticks in TCB         */
        OS_EXIT_CRITICAL();
        OS_Sched();                                                       /* Find next task to run!    */
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                     DELAY TASK FOR SPECIFIED TIME
*
* Description: This function is called to delay execution of the currently running task until some time
*              expires.  This call allows you to specify the delay time in HOURS, MINUTES, SECONDS and
*              MILLISECONDS instead of ticks.
*
* Arguments  : hours     specifies the number of hours that the task will be delayed (max. is 255)
*              minutes   specifies the number of minutes (max. 59)
*              seconds   specifies the number of seconds (max. 59)
*              milli     specifies the number of milliseconds (max. 999)
*
* Returns    : OS_NO_ERR
*              OS_TIME_INVALID_MINUTES
*              OS_TIME_INVALID_SECONDS
*              OS_TIME_INVALID_MS
*              OS_TIME_ZERO_DLY
*
* Note(s)    : The resolution on the milliseconds depends on the tick rate.  For example, you can't do
*              a 10 mS delay if the ticker interrupts every 100 mS.  In this case, the delay would be
*              set to 0.  The actual delay is rounded to the nearest tick.
*********************************************************************************************************
*/

#if OS_TIME_DLY_HMSM_EN > 0
INT8U  OSTimeDlyHMSM (INT8U hours, INT8U minutes, INT8U seconds, INT16U milli)
{
    INT32U ticks;
    INT16U loops;


    if (hours > 0 || minutes > 0 || seconds > 0 || milli > 0) {
        if (minutes > 59) {
            return (OS_TIME_INVALID_MINUTES);    /* Validate arguments to be within range              */
        }
        if (seconds > 59) {
            return (OS_TIME_INVALID_SECONDS);
        }
        if (milli > 999) {
            return (OS_TIME_INVALID_MILLI);
        }
                                                 /* Compute the total number of clock ticks required.. */
                                                 /* .. (rounded to the nearest tick)                   */
        ticks = ((INT32U)hours * 3600L + (INT32U)minutes * 60L + (INT32U)seconds) * OS_TICKS_PER_SEC
              + OS_TICKS_PER_SEC * ((INT32U)milli + 500L / OS_TICKS_PER_SEC) / 1000L;
        loops = (INT16U)(ticks / 65536L);        /* Compute the integral number of 65536 tick delays   */
        ticks = ticks % 65536L;                  /* Obtain  the fractional number of ticks             */
        OSTimeDly((INT16U)ticks);
        while (loops > 0) {
            OSTimeDly(32768);
            OSTimeDly(32768);
            loops--;
        }
        return (OS_NO_ERR);
    }
    return (OS_TIME_ZERO_DLY);
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                         RESUME A DELAYED TASK
*
* Description: This function is used resume a task that has been delayed through a call to either
*              OSTimeDly() or OSTimeDlyHMSM().  Note that you MUST NOT call this function to resume a
*              task that is waiting for an event with timeout.  This situation would make the task look
*              like a timeout occurred (unless you desire this effect).  Also, you cannot resume a task
*              that has called OSTimeDlyHMSM() with a combined time that exceeds 65535 clock ticks.  In
*              other words, if the clock tick runs at 100 Hz then, you will not be able to resume a
*              delayed task that called OSTimeDlyHMSM(0, 10, 55, 350) or higher.
*
*                  (10 Minutes * 60 + 55 Seconds + 0.35) * 100 ticks/second.
*
* Arguments  : prio      specifies the priority of the task to resume
*
* Returns    : OS_NO_ERR                 Task has been resumed
*              OS_PRIO_INVALID           if the priority you specify is higher that the maximum allowed
*                                        (i.e. >= OS_LOWEST_PRIO)
*              OS_TIME_NOT_DLY           Task is not waiting for time to expire
*              OS_TASK_NOT_EXIST         The desired task has not been created
*********************************************************************************************************
*/

#if OS_TIME_DLY_RESUME_EN > 0
INT8U  OSTimeDlyResume (INT8U prio)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    OS_TCB    *ptcb;


    if (prio >= OS_LOWEST_PRIO) {
        return (OS_PRIO_INVALID);
    }
    OS_ENTER_CRITICAL();
    ptcb = (OS_TCB *)OSTCBPrioTbl[prio];                   /* Make sure that task exist                */
    if (ptcb != (OS_TCB *)0) {
        if (ptcb->OSTCBDly != 0) {                         /* See if task is delayed                   */
            ptcb->OSTCBDly  = 0;                           /* Clear the time delay                     */
            if ((ptcb->OSTCBStat & OS_STAT_SUSPEND) == OS_STAT_RDY) {  /* See if task is ready to run  */
                OSRdyGrp               |= ptcb->OSTCBBitY;             /* Make task ready to run       */
                OSRdyTbl[ptcb->OSTCBY] |= ptcb->OSTCBBitX;
                OS_EXIT_CRITICAL();
                OS_Sched();                                /* See if this is new highest priority      */
            } else {
                OS_EXIT_CRITICAL();                        /* Task may be suspended                    */
            }
            return (OS_NO_ERR);
        } else {
            OS_EXIT_CRITICAL();
            return (OS_TIME_NOT_DLY);                      /* Indicate that task was not delayed       */
        }
    }
    OS_EXIT_CRITICAL();
    return (OS_TASK_NOT_EXIST);                            /* The task does not exist                  */
}
#endif    
/*$PAGE*/
/*
*********************************************************************************************************
*                                         GET CURRENT SYSTEM TIME
*
* Description: This function is used by your application to obtain the current value of the 32-bit
*              counter which keeps track of the number of clock ticks.
*
* Arguments  : none
*
* Returns    : The current value of OSTime
*********************************************************************************************************
*/

#if OS_TIME_GET_SET_EN > 0
INT32U  OSTimeGet (void)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    INT32U     ticks;


    OS_ENTER_CRITICAL();
    ticks = OSTime;
    OS_EXIT_CRITICAL();
    return (ticks);
}
#endif    

/*
*********************************************************************************************************
*                                            SET SYSTEM CLOCK
*
* Description: This function sets the 32-bit counter which keeps track of the number of clock ticks.
*
* Arguments  : ticks      specifies the new value that OSTime needs to take.
*
* Returns    : none
*********************************************************************************************************
*/

#if OS_TIME_GET_SET_EN > 0
void  OSTimeSet (INT32U ticks)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    


    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}
#endif    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区三免费高清| 精品一区二区三区在线观看国产 | 在线观看日韩高清av| 9久草视频在线视频精品| 成人av网站在线| 97久久久精品综合88久久| 色综合视频一区二区三区高清| 99精品久久99久久久久| 色88888久久久久久影院按摩| 欧美亚洲一区二区三区四区| 欧美日韩大陆一区二区| 日韩一区二区中文字幕| 精品国产精品一区二区夜夜嗨| 久久综合狠狠综合久久激情| 国产嫩草影院久久久久| 亚洲欧洲韩国日本视频| 亚洲激情五月婷婷| 日韩精品欧美成人高清一区二区| 美女在线一区二区| 国产精品白丝jk黑袜喷水| 91视频观看视频| 欧美日韩日日夜夜| 久久久久久亚洲综合影院红桃| 中文一区二区在线观看| 玉足女爽爽91| 麻豆91在线看| av一区二区三区| 欧美喷水一区二区| 国产欧美日韩中文久久| 亚洲一区中文在线| 久久99精品久久久久久国产越南| 丁香亚洲综合激情啪啪综合| 色狠狠av一区二区三区| 日韩欧美电影一二三| 中文字幕一区二区三区在线不卡 | 欧美一区二区美女| 国产丝袜欧美中文另类| 一区二区国产视频| 紧缚捆绑精品一区二区| 91在线免费播放| 日韩免费高清电影| 中文字幕一区二区三区不卡 | 亚洲综合免费观看高清完整版 | 精彩视频一区二区| 色综合天天做天天爱| 日韩午夜三级在线| 中文字幕日韩精品一区| 蜜臀a∨国产成人精品| 99精品一区二区| 日韩欧美视频一区| 亚洲品质自拍视频网站| 麻豆一区二区99久久久久| 99久久久无码国产精品| 日韩视频在线永久播放| 亚洲丝袜自拍清纯另类| 蜜臀av一区二区| 色综合天天天天做夜夜夜夜做| 日韩欧美国产高清| 亚洲一卡二卡三卡四卡无卡久久| 五月激情丁香一区二区三区| 成av人片一区二区| 日韩三级视频在线看| 亚洲精品久久7777| 成人黄动漫网站免费app| 日韩一级成人av| 亚洲国产精品一区二区久久恐怖片 | 椎名由奈av一区二区三区| 久久精品国产久精国产爱| 欧美亚州韩日在线看免费版国语版| 国产午夜精品一区二区三区嫩草 | 日本sm残虐另类| 91久久奴性调教| 久久精品亚洲精品国产欧美kt∨ | 国产精品国产三级国产普通话三级| 丝袜诱惑制服诱惑色一区在线观看| 国产成人超碰人人澡人人澡| 欧美一区二区久久久| 亚洲国产综合色| 99久免费精品视频在线观看| 久久久久久一级片| 激情深爱一区二区| 欧美一区二区三区电影| 亚洲电影在线播放| 色悠久久久久综合欧美99| 国产精品色婷婷| 国产精品伊人色| 日韩精品一区二区在线| 亚洲人成在线观看一区二区| 国产成人免费av在线| 精品人伦一区二区色婷婷| 偷拍日韩校园综合在线| 欧美日韩和欧美的一区二区| 亚洲精品成人悠悠色影视| 99精品视频一区二区| 国产精品高清亚洲| 丰满亚洲少妇av| 欧美激情资源网| 国产精品一区二区三区网站| 久久色.com| 国产原创一区二区| 亚洲精品在线免费观看视频| 激情亚洲综合在线| 久久噜噜亚洲综合| 国产一区二区h| 国产午夜精品理论片a级大结局| 精油按摩中文字幕久久| 精品久久久久久无| 狠狠色丁香久久婷婷综合丁香| 欧美电视剧在线看免费| 久久99精品一区二区三区 | 99精品1区2区| 亚洲色图在线播放| 色噜噜久久综合| 亚洲一区二区欧美日韩| 欧美日韩在线电影| 日本中文字幕一区| 精品国产乱码久久久久久免费| 久久精品国产亚洲一区二区三区 | 日本福利一区二区| 亚洲在线视频一区| 欧美日韩国产综合草草| 视频一区欧美精品| 日韩视频永久免费| 国产美女视频91| 国产精品视频免费| 一本大道久久精品懂色aⅴ| 亚洲动漫第一页| 日韩欧美久久一区| 成人精品免费网站| 亚洲裸体在线观看| 欧美性受极品xxxx喷水| 日韩中文字幕不卡| 久久亚洲捆绑美女| 97久久精品人人做人人爽50路| 亚洲一区在线看| 精品久久人人做人人爱| 高清不卡一区二区| 亚洲精品乱码久久久久久黑人| 欧美久久久久久久久| 国内精品视频666| 国产精品久久久一区麻豆最新章节| 一本大道综合伊人精品热热| 日韩激情一二三区| www久久精品| eeuss鲁片一区二区三区| 亚洲午夜久久久久中文字幕久| 日韩视频免费观看高清完整版 | 国产高清久久久| 亚洲欧美色图小说| 7777精品伊人久久久大香线蕉经典版下载 | 成人黄色小视频| 亚洲成人av免费| 久久久久久久久99精品| 91国偷自产一区二区三区观看| 美女一区二区视频| 成人欧美一区二区三区| 欧美一区二区在线视频| 不卡av在线网| 日韩国产欧美一区二区三区| 国产精品美女久久久久久久久| 欧美精品亚洲二区| av亚洲产国偷v产偷v自拍| 日韩国产欧美在线观看| 中文av一区二区| 91精品国产高清一区二区三区蜜臀| 国产福利91精品| 亚洲成人av电影在线| 中文字幕不卡在线| 欧美一区二区三区的| 99国产精品久久久| 久久99国产精品久久99果冻传媒 | 日韩一区二区视频在线观看| 成人妖精视频yjsp地址| 丝瓜av网站精品一区二区| 中文字幕成人在线观看| 日韩一级成人av| 欧美综合久久久| 大桥未久av一区二区三区中文| 日本欧美一区二区三区乱码| 亚洲欧美日韩久久| 久久五月婷婷丁香社区| 7777女厕盗摄久久久| 一本到高清视频免费精品| 国产成人午夜精品影院观看视频| 午夜私人影院久久久久| 综合亚洲深深色噜噜狠狠网站| 精品精品欲导航| 欧美日韩亚洲综合一区二区三区| www.一区二区| 国产麻豆成人精品| 久久国产日韩欧美精品| 日韩精品欧美精品| 亚洲小说欧美激情另类| 亚洲日本乱码在线观看| 国产情人综合久久777777| 精品日韩99亚洲| 日韩欧美中文字幕一区| 欧美老肥妇做.爰bbww视频| 一本久久a久久精品亚洲| www.欧美色图|