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

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

?? os_time.c

?? uC/OS-II在51上移植的完整源代碼V1.0
?? 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 "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一区二区三区免费野_久草精品视频
日韩**一区毛片| 欧洲色大大久久| 精品少妇一区二区三区日产乱码 | 蜜桃传媒麻豆第一区在线观看| 欧美日本国产一区| 亚洲h动漫在线| 欧美一区二区三区性视频| 美女一区二区视频| 26uuu精品一区二区| 国产成人精品影院| 奇米色777欧美一区二区| 在线不卡欧美精品一区二区三区| 日韩激情在线观看| 久久综合99re88久久爱| 成人精品在线视频观看| 亚洲日本护士毛茸茸| 欧美色爱综合网| 另类小说视频一区二区| 中文字幕免费不卡在线| 欧美在线三级电影| 免费高清在线视频一区·| 久久亚洲精品国产精品紫薇| 不卡的av在线播放| 天天综合网 天天综合色| 久久综合九色综合97婷婷女人| 波多野结衣中文字幕一区二区三区| 亚洲精品国产成人久久av盗摄 | 一本色道久久加勒比精品| 椎名由奈av一区二区三区| 欧美色综合影院| 国产综合久久久久久久久久久久| 国产精品看片你懂得| 欧美二区三区的天堂| 国产在线不卡一区| 一区二区三区中文免费| 精品日韩在线观看| 91麻豆国产在线观看| 久草这里只有精品视频| 亚洲婷婷综合色高清在线| 7777精品伊人久久久大香线蕉最新版 | 亚洲一区欧美一区| 亚洲毛片av在线| 欧美一区二区三区白人| 99精品黄色片免费大全| 日本91福利区| 欧美国产日韩亚洲一区| 欧美色爱综合网| 日本不卡一二三| 欧美视频在线观看一区二区| 精品制服美女丁香| 亚洲一二三四在线| 国产精品系列在线| 日韩欧美一级二级| 欧美亚洲综合网| 成人性生交大片免费看在线播放| 日韩国产一区二| 亚洲精选一二三| 中文字幕乱码久久午夜不卡| 欧美成人免费网站| 欧美精品第1页| 91福利社在线观看| 97久久精品人人做人人爽50路| 精品一区二区日韩| 午夜精品久久久久久久久久| 亚洲欧美偷拍卡通变态| 中文字幕国产一区二区| 精品国产sm最大网站| 欧美一二三四在线| 91.xcao| 欧美日本一区二区| 日本韩国欧美国产| 99精品国产视频| 成人h精品动漫一区二区三区| 国产乱码一区二区三区| 激情综合亚洲精品| 久久精品国内一区二区三区| 日产欧产美韩系列久久99| 亚洲mv在线观看| 日韩在线观看一区二区| 亚洲主播在线播放| 亚洲第一久久影院| 水蜜桃久久夜色精品一区的特点| 亚洲最大的成人av| 亚洲一级二级在线| 婷婷久久综合九色综合伊人色| 亚洲国产另类精品专区| 亚洲综合精品自拍| 亚洲成av人片一区二区梦乃 | 欧美一级午夜免费电影| 欧美人伦禁忌dvd放荡欲情| 欧美怡红院视频| 777欧美精品| 日韩欧美一级二级三级久久久| 日韩三级中文字幕| 久久久久久亚洲综合影院红桃| 久久综合久久久久88| 久久这里只有精品首页| 中文字幕二三区不卡| 亚洲视频一二三区| 亚洲五月六月丁香激情| 视频一区免费在线观看| 精品一区二区三区免费毛片爱| 国产一区免费电影| 成人激情综合网站| 在线观看国产一区二区| 精品视频在线免费观看| 日韩欧美亚洲一区二区| 久久精品亚洲一区二区三区浴池| 国产精品电影一区二区| 夜夜夜精品看看| 麻豆精品久久精品色综合| 国产麻豆视频一区| 色婷婷激情久久| 日韩欧美高清dvd碟片| 国产欧美日本一区视频| 亚洲午夜精品一区二区三区他趣| 免费观看成人鲁鲁鲁鲁鲁视频| 国产高清亚洲一区| 在线观看区一区二| 日本三级亚洲精品| 欧美激情在线一区二区三区| 亚洲精品在线网站| 国产精品初高中害羞小美女文| 午夜av区久久| 成人激情动漫在线观看| 精品视频1区2区| 国产欧美日韩精品在线| 亚洲国产wwwccc36天堂| 国产成人午夜精品影院观看视频| 91官网在线免费观看| 国产亚洲一本大道中文在线| 亚洲高清一区二区三区| 国产福利电影一区二区三区| 欧美日本在线视频| 亚洲欧洲精品一区二区三区不卡| 日韩精品午夜视频| 91麻豆国产自产在线观看| 日韩精品一区二区在线| 亚洲黄色av一区| 国产ts人妖一区二区| 欧美一级黄色录像| 亚洲另类色综合网站| 国产成a人亚洲精| 日韩欧美亚洲一区二区| 亚洲国产精品一区二区www | 色婷婷激情综合| 国产精品亚洲成人| 欧美少妇性性性| 国产精品国产三级国产a| 精品一区二区在线视频| 91激情五月电影| 国产精品女主播av| 国产自产高清不卡| 欧美福利电影网| 亚洲国产中文字幕| 色呦呦日韩精品| 国产精品欧美一区喷水| 国产美女av一区二区三区| 欧美一卡2卡3卡4卡| 天堂成人免费av电影一区| 久久伊人中文字幕| 日韩精品乱码av一区二区| 欧美日韩在线不卡| 亚洲国产三级在线| 精品污污网站免费看| 亚洲一级二级三级| 欧美系列在线观看| 一区二区三区国产豹纹内裤在线| 成人午夜av影视| 国产精品久久久久久久久搜平片| 国产传媒一区在线| 久久久国产午夜精品| 国产馆精品极品| 久久久国产精品不卡| 国产高清不卡一区| 国产精品免费网站在线观看| 国v精品久久久网| 欧美激情一区二区在线| 成人久久视频在线观看| 亚洲色欲色欲www在线观看| av影院午夜一区| 亚洲男人的天堂一区二区| 91污在线观看| 亚洲一区二区三区中文字幕| 欧美视频在线一区二区三区| 亚洲成av人在线观看| 欧美美女直播网站| 麻豆精品新av中文字幕| 欧美精品一区视频| 成人黄色免费短视频| 亚洲欧美日韩在线播放| 欧美日韩三级视频| 青青草国产成人99久久| 久久久久久99久久久精品网站| 成人手机电影网| 亚洲午夜久久久久久久久电影网| 制服丝袜国产精品| 国产成人精品网址| 亚洲一区二区三区精品在线| 欧美一激情一区二区三区|