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

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

?? os_time.c

?? 51單片機web的ucosii
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                        (c) Copyright 1992-1998, Jean J. Labrosse, Plantation, FL
*                                           All Rights Reserved
*
*                                                  V2.00
*
* File : OS_TIME.C
* By   : Jean J. Labrosse
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#include    <CORE\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) reentrant
{
    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();
        OSSched();                                                        /* 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.
*********************************************************************************************************
*/

INT8U OSTimeDlyHMSM (INT8U hours, INT8U minutes, INT8U seconds, INT16U milli) reentrant
{
    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 = ticks / 65536L;                  /* Compute the integral number of 65536 tick delays   */
        ticks = ticks % 65536L;                  /* Obtain  the fractional number of ticks             */
        OSTimeDly(ticks);
        while (loops > 0) {
            OSTimeDly(32768);
            OSTimeDly(32768);
            loops--;
        }
        return (OS_NO_ERR);
    } else {
        return (OS_TIME_ZERO_DLY);
    }
}
/*$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
*********************************************************************************************************
*/

INT8U OSTimeDlyResume (INT8U prio) reentrant
{
    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)) {    /* See if task is ready to run              */
                OSRdyGrp               |= ptcb->OSTCBBitY; /* Make task ready to run                   */
                OSRdyTbl[ptcb->OSTCBY] |= ptcb->OSTCBBitX;
                OS_EXIT_CRITICAL();
                OSSched();                                 /* 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       */
        }
    } else {
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);                        /* The task does not exist                  */
    }
}
/*$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
*********************************************************************************************************
*/

INT32U OSTimeGet (void) reentrant
{
    INT32U ticks;


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

/*
*********************************************************************************************************
*                                            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
*********************************************************************************************************
*/

void OSTimeSet (INT32U ticks) reentrant
{
    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品网曝门| 亚洲小说春色综合另类电影| 成人一区二区三区| 亚洲国产精品传媒在线观看| 91麻豆精东视频| 麻豆国产精品777777在线| 国产三级精品视频| 欧美日韩一区二区三区四区五区| 久久99热99| 日韩精品高清不卡| 亚洲欧洲国产日本综合| 中文字幕一区二区三区不卡在线| 色素色在线综合| 国产成人av一区二区三区在线 | 欧美日本韩国一区二区三区视频 | 成人av动漫在线| 欧美一级艳片视频免费观看| 国产精品亚洲专一区二区三区 | 欧美日韩一二区| 91蝌蚪porny| 欧美中文一区二区三区| 欧美狂野另类xxxxoooo| 欧美精品成人一区二区三区四区| 欧美高清视频一二三区| 91.xcao| 欧美日韩在线不卡| 欧美三级视频在线| 色婷婷激情综合| 日韩免费高清电影| 日韩美女视频一区| 中文字幕第一区二区| 久久一二三国产| 国产精品免费丝袜| 亚洲美女少妇撒尿| 香蕉影视欧美成人| 九九视频精品免费| 成人福利在线看| 色综合久久综合| 在线电影一区二区三区| 欧美一区二区私人影院日本| 欧美一区二区观看视频| 国产视频一区二区三区在线观看 | 日韩你懂的在线观看| 欧美日本高清视频在线观看| 日韩视频永久免费| 亚洲欧美激情插| 久久av老司机精品网站导航| 成人精品国产免费网站| 91精品黄色片免费大全| 亚洲欧美国产77777| 亚洲成av人片在线| 成人性生交大片免费看中文| 欧美日韩一二三区| 一区二区高清视频在线观看| 国产成人免费视频| 国产成都精品91一区二区三| 欧美精品一区二区不卡| 国产不卡在线视频| 亚洲素人一区二区| 欧美久久久影院| 国产精品性做久久久久久| 中文字幕永久在线不卡| 欧美日本乱大交xxxxx| 精品一二线国产| 亚洲免费观看高清完整| 日韩欧美中文字幕精品| 国产黄色91视频| 无码av免费一区二区三区试看| 欧美va在线播放| 欧美又粗又大又爽| 国产传媒一区在线| 蜜臀va亚洲va欧美va天堂| 欧美国产欧美综合| 欧美一级黄色片| 欧洲日韩一区二区三区| www.日韩在线| 国产综合色在线| 免费看欧美女人艹b| 亚洲精品v日韩精品| 久久久99久久| 欧美精品一区男女天堂| 91精品午夜视频| 欧洲生活片亚洲生活在线观看| 99国产精品久| 国产999精品久久| 成人少妇影院yyyy| 国产精品18久久久久| 久久国产三级精品| 久久激情五月婷婷| 寂寞少妇一区二区三区| 亚洲第一搞黄网站| 91.麻豆视频| 色综合久久久久综合99| 久久99精品久久久| 午夜精品久久久久影视| 亚洲在线免费播放| 综合分类小说区另类春色亚洲小说欧美| 在线播放中文字幕一区| 色综合天天综合给合国产| 成人黄色大片在线观看| 国产成人自拍网| 国产成人一区在线| 国产精选一区二区三区| 韩国av一区二区三区在线观看| 亚洲国产精品自拍| 日韩在线a电影| 免费在线看成人av| 国产精品1024久久| 国产成人高清视频| 色综合视频在线观看| 色视频一区二区| 日韩一区二区精品| 国产色91在线| 亚洲综合男人的天堂| 日韩制服丝袜先锋影音| 国内国产精品久久| 成人精品小蝌蚪| 91成人免费在线| 欧亚洲嫩模精品一区三区| 欧美精品99久久久**| 亚洲色图丝袜美腿| 一区二区中文字幕在线| 91精品福利在线一区二区三区| 日韩三级中文字幕| 亚洲色图20p| 成人小视频在线| 日韩欧美久久一区| 日韩精品欧美精品| 欧美性感一类影片在线播放| 国产精品三级在线观看| 老司机精品视频一区二区三区| 色天使色偷偷av一区二区| 中文字幕亚洲一区二区va在线| 久久er99热精品一区二区| 韩国理伦片一区二区三区在线播放 | 日韩欧美亚洲一区二区| av午夜一区麻豆| 色av综合在线| 久久亚区不卡日本| 国产精品短视频| 日韩高清一区二区| 欧美性生活影院| 欧美日韩一区二区在线观看视频| 精品亚洲欧美一区| 一本色道久久综合亚洲aⅴ蜜桃 | 国产福利一区在线观看| 欧美亚洲国产bt| 久久女同性恋中文字幕| 一区二区高清免费观看影视大全| 日韩一区精品视频| 91视频一区二区| 久久久亚洲精品石原莉奈| 亚洲一区二区三区中文字幕在线| 国产露脸91国语对白| 91麻豆精品国产无毒不卡在线观看| 国产日韩精品一区| 另类中文字幕网| 日韩一级完整毛片| 午夜精品久久久久久不卡8050 | av亚洲精华国产精华精| 久久综合中文字幕| 久久国产精品99久久人人澡| 欧美吻胸吃奶大尺度电影| 日韩你懂的在线播放| 国产精品久久国产精麻豆99网站| 蜜桃视频在线一区| 欧美日韩高清一区二区三区| 国产亚洲欧美一级| 国产成人免费在线| 在线观看视频91| 亚洲欧美电影院| 91在线精品秘密一区二区| 国产欧美一区二区在线| 美女视频网站久久| 久久精品一区二区三区四区| 亚洲成a人v欧美综合天堂下载| 91久久精品午夜一区二区| 久久久久久久综合色一本| 亚洲线精品一区二区三区八戒| 色先锋aa成人| 日韩电影在线观看电影| 欧美裸体一区二区三区| 亚洲欧美经典视频| 欧美日韩在线播放| 日韩一区精品字幕| 国产无一区二区| 色哟哟欧美精品| 亚洲h在线观看| 91精品国产91热久久久做人人 | 国产99久久久国产精品免费看| 欧美韩国日本一区| 国产99久久久久| 一区二区三区免费在线观看| 欧美一区二区三区视频免费 | 国产精品自拍一区| 国产精品久线在线观看| 欧美日韩情趣电影| 美女尤物国产一区| 中文字幕在线不卡国产视频| 91精品国产综合久久久久久久久久 |