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

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

?? os_time.c

?? 在51單片機上移植成功的UCOS-II操作系統源代碼,包括源代碼及相關注釋
?? 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一区二区三区免费野_久草精品视频
国模冰冰炮一区二区| 国产乱一区二区| 蜜臀精品一区二区三区在线观看 | 国产精品天天摸av网| 亚洲另类中文字| 国产伦精品一区二区三区视频青涩| 3751色影院一区二区三区| 精品少妇一区二区三区免费观看 | 亚洲欧美怡红院| 久久99精品久久久久久动态图| 91麻豆精品视频| 91精品国产91久久久久久最新毛片| 亚洲天堂av老司机| 国产在线播放一区二区三区| 欧美电影在线免费观看| 国产精品久久久久久亚洲伦| 国产综合一区二区| 欧美日韩国产系列| 亚洲精品中文在线影院| 丁香桃色午夜亚洲一区二区三区| 91精品国产综合久久久久| 亚洲欧洲成人自拍| 懂色av一区二区在线播放| 日韩一区二区影院| 婷婷国产在线综合| 在线中文字幕一区| 亚洲欧美日韩国产综合在线| 成人免费毛片片v| 国产日韩精品一区二区三区| 国模少妇一区二区三区| 欧美一区二区国产| 日韩国产欧美在线播放| 欧美日韩中文国产| 亚洲综合在线观看视频| 99re这里都是精品| 国产精品色噜噜| 国产精品亚洲综合一区在线观看| 日韩三级av在线播放| 五月综合激情日本mⅴ| 欧美性猛片aaaaaaa做受| 国产精品日日摸夜夜摸av| 麻豆国产精品一区二区三区| 欧美成人在线直播| 激情五月婷婷综合网| 精品国产一区二区三区忘忧草| 蜜臀av一级做a爰片久久| 欧美在线一二三四区| 国产精品国产自产拍高清av| av在线不卡网| 一区精品在线播放| 粉嫩一区二区三区在线看| 亚洲精品一区二区在线观看| 国产一区二区导航在线播放| 国产在线不卡一区| 日韩一级二级三级| 蜜桃av一区二区| 国产夜色精品一区二区av| 韩国欧美国产一区| 国产欧美日韩一区二区三区在线观看 | 久久网这里都是精品| 国产曰批免费观看久久久| 国产日韩欧美麻豆| 91麻豆国产香蕉久久精品| 亚洲一二三四久久| 欧美大片国产精品| 不卡一卡二卡三乱码免费网站 | 久久久久一区二区三区四区| 国产成人精品亚洲777人妖| ...中文天堂在线一区| 欧美日韩一区不卡| 韩国中文字幕2020精品| 成人免费在线播放视频| 欧美欧美欧美欧美| 福利电影一区二区三区| 亚洲一二三区不卡| 久久青草欧美一区二区三区| 97精品超碰一区二区三区| 天堂成人国产精品一区| 欧美国产日韩在线观看| 欧美精品v国产精品v日韩精品| 国产乱码精品一区二区三区av | 日韩精品一二三四| 欧美韩国日本不卡| 欧美久久久久久蜜桃| 高清免费成人av| 日韩国产欧美三级| 综合电影一区二区三区 | 免费高清视频精品| 亚洲欧洲制服丝袜| 久久色在线视频| 欧美一区二区三区性视频| 99久久精品免费精品国产| 精品一区中文字幕| 偷拍与自拍一区| 最近中文字幕一区二区三区| 亚洲精品在线三区| 欧美日韩国产首页在线观看| gogo大胆日本视频一区| 国产在线精品视频| 日韩国产欧美在线视频| 亚洲精品五月天| 国产精品无码永久免费888| 日韩欧美在线一区二区三区| 欧美丝袜丝交足nylons图片| 丁香激情综合国产| 天堂精品中文字幕在线| 一区二区三区日韩精品视频| 国产精品女上位| 欧美激情一区二区| 国产网红主播福利一区二区| xnxx国产精品| 久久久一区二区| 久久色在线视频| 久久久久久夜精品精品免费| 亚洲精品一区二区精华| 日韩精品一区二区三区在线播放| 欧美日韩国产另类一区| 欧美日韩一区 二区 三区 久久精品| 色婷婷av一区二区三区大白胸| 99精品国产视频| 91国内精品野花午夜精品| 91丨九色丨黑人外教| 97久久超碰精品国产| 91亚洲男人天堂| 91片在线免费观看| 91伊人久久大香线蕉| 91年精品国产| 91国偷自产一区二区三区成为亚洲经典 | 在线不卡a资源高清| 在线观看91精品国产入口| 欧美在线免费播放| 欧美日韩国产小视频在线观看| 欧美丰满少妇xxxbbb| 日韩视频一区二区三区| 精品成a人在线观看| 久久久午夜电影| 欧美激情一区在线| 自拍偷在线精品自拍偷无码专区 | 久久久99久久| 中文字幕一区二区三区精华液 | 亚洲精品一区二区三区99| 国产色一区二区| 亚洲色图20p| 日韩影院免费视频| 国产永久精品大片wwwapp| 处破女av一区二区| 日本国产一区二区| 91麻豆精品国产91久久久久久 | 国产精品免费免费| 亚洲精品成人a在线观看| 亚洲动漫第一页| 激情五月播播久久久精品| 99久久99久久精品免费看蜜桃| 欧美日韩一级二级| 久久久久久久久久美女| 亚洲免费av高清| 蜜桃视频在线观看一区| 不卡在线观看av| 日韩三区在线观看| 中文字幕中文字幕在线一区| 日韩电影一区二区三区| www.激情成人| 欧美一区二区福利在线| 日本一区二区三区在线不卡| 亚洲高清一区二区三区| 国产一区免费电影| 欧美午夜电影一区| 国产亚洲va综合人人澡精品| 午夜精品国产更新| 不卡的看片网站| 精品国产一区a| 亚洲国产一区视频| 丰满放荡岳乱妇91ww| 欧美一区二区三区在线观看视频| 亚洲天堂a在线| 国产成人av一区二区三区在线| 在线成人av影院| 亚洲精品日韩综合观看成人91| 韩国中文字幕2020精品| 欧美伦理电影网| 亚洲视频一二三| 国产精品资源站在线| 337p亚洲精品色噜噜| 一级女性全黄久久生活片免费| 国产99久久久国产精品| 日韩一区二区免费在线观看| 亚洲欧美二区三区| 国产电影一区二区三区| 欧美电视剧免费全集观看| 婷婷中文字幕一区三区| 色94色欧美sute亚洲13| 国产精品久久久爽爽爽麻豆色哟哟 | 一区二区理论电影在线观看| 成人伦理片在线| 日本一区二区在线不卡| 精品一区二区av| 欧美刺激午夜性久久久久久久| 美女在线视频一区| 亚洲精品一区二区在线观看| 亚洲地区一二三色|