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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? os_time.c

?? UCOS2.85的源代碼
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2007, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_TIME.C
* By      : Jean J. Labrosse
* Version : V2.85
*
* LICENSING TERMS:
* ---------------
*   uC/OS-II is provided in source form for FREE evaluation, for educational use or for peaceful research.  
* If you plan on using  uC/OS-II  in a commercial product you need to contact Micri祄 to properly license 
* its use in your product. We provide ALL the source code for your convenience and to help you experience 
* uC/OS-II.   The fact that the  source is provided does  NOT  mean that you can use it without  paying a 
* licensing fee.
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#include <ucos_ii.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)
{
    INT8U      y;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#endif



    if (OSIntNesting > 0) {                      /* See if trying to call from an ISR                  */
        return;
    }
    if (ticks > 0) {                             /* 0 means no delay!                                  */
        OS_ENTER_CRITICAL();
        y            =  OSTCBCur->OSTCBY;        /* Delay current task                                 */
        OSRdyTbl[y] &= ~OSTCBCur->OSTCBBitX;
        if (OSRdyTbl[y] == 0) {
            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_ERR_NONE
*              OS_ERR_TIME_INVALID_MINUTES
*              OS_ERR_TIME_INVALID_SECONDS
*              OS_ERR_TIME_INVALID_MS
*              OS_ERR_TIME_ZERO_DLY
*              OS_ERR_TIME_DLY_ISR
*
* 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 ms)
{
    INT32U ticks;
    INT16U loops;


    if (OSIntNesting > 0) {                      /* See if trying to call from an ISR                  */
        return (OS_ERR_TIME_DLY_ISR);
    }
#if OS_ARG_CHK_EN > 0
    if (hours == 0) {
        if (minutes == 0) {
            if (seconds == 0) {
                if (ms == 0) {
                    return (OS_ERR_TIME_ZERO_DLY);
                }
            }
        }
    }
    if (minutes > 59) {
        return (OS_ERR_TIME_INVALID_MINUTES);    /* Validate arguments to be within range              */
    }
    if (seconds > 59) {
        return (OS_ERR_TIME_INVALID_SECONDS);
    }
    if (ms > 999) {
        return (OS_ERR_TIME_INVALID_MS);
    }
#endif
                                                 /* 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)ms + 500L / OS_TICKS_PER_SEC) / 1000L;
    loops = (INT16U)(ticks >> 16);               /* Compute the integral number of 65536 tick delays   */
    ticks = ticks & 0xFFFFL;                     /* Obtain  the fractional number of ticks             */
    OSTimeDly((INT16U)ticks);
    while (loops > 0) {
        OSTimeDly((INT16U)32768u);
        OSTimeDly((INT16U)32768u);
        loops--;
    }
    return (OS_ERR_NONE);
}
#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 can call this function to resume a
*              task that is waiting for an event with timeout.  This would make the task look
*              like a timeout occurred.
*
*              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_ERR_NONE               Task has been resumed
*              OS_ERR_PRIO_INVALID       if the priority you specify is higher that the maximum allowed
*                                        (i.e. >= OS_LOWEST_PRIO)
*              OS_ERR_TIME_NOT_DLY       Task is not waiting for time to expire
*              OS_ERR_TASK_NOT_EXIST     The desired task has not been created or has been assigned to a Mutex.
*********************************************************************************************************
*/

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



    if (prio >= OS_LOWEST_PRIO) {
        return (OS_ERR_PRIO_INVALID);
    }
    OS_ENTER_CRITICAL();
    ptcb = OSTCBPrioTbl[prio];                                 /* Make sure that task exist            */
    if (ptcb == (OS_TCB *)0) {
        OS_EXIT_CRITICAL();
        return (OS_ERR_TASK_NOT_EXIST);                        /* The task does not exist              */
    }
    if (ptcb == OS_TCB_RESERVED) {
        OS_EXIT_CRITICAL();
        return (OS_ERR_TASK_NOT_EXIST);                        /* The task does not exist              */
    }
    if (ptcb->OSTCBDly == 0) {                                 /* See if task is delayed               */
        OS_EXIT_CRITICAL();
        return (OS_ERR_TIME_NOT_DLY);                          /* Indicate that task was not delayed   */
    }

    ptcb->OSTCBDly = 0;                                        /* Clear the time delay                 */
    if ((ptcb->OSTCBStat & OS_STAT_PEND_ANY) != OS_STAT_RDY) {
        ptcb->OSTCBStat     &= ~OS_STAT_PEND_ANY;              /* Yes, Clear status flag               */
        ptcb->OSTCBStatPend  =  OS_STAT_PEND_TO;               /* Indicate PEND timeout                */
    } else {
        ptcb->OSTCBStatPend  =  OS_STAT_PEND_OK;
    }
    if ((ptcb->OSTCBStat & OS_STAT_SUSPEND) == OS_STAT_RDY) {  /* Is task suspended?                   */
        OSRdyGrp               |= ptcb->OSTCBBitY;             /* No,  Make ready                      */
        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_ERR_NONE);
}
#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)
{
    INT32U     ticks;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#endif



    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 = 0;
#endif



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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美亚洲国产一区二区三区va | 日本不卡一区二区| 久久综合国产精品| 欧美视频在线一区| 成人一级视频在线观看| 五月婷婷欧美视频| 国产精品成人一区二区艾草| 日韩欧美视频一区| 欧美在线不卡视频| 成人免费视频一区| 精品一区二区三区免费观看| 亚洲成人黄色影院| 亚洲日本在线看| 国产日韩欧美一区二区三区综合| 欧美高清你懂得| 91网站在线播放| 国产不卡免费视频| 国产制服丝袜一区| 六月丁香婷婷色狠狠久久| 亚洲主播在线播放| 亚洲欧美激情小说另类| 日本一区二区三区在线不卡| 日韩欧美国产精品一区| 777久久久精品| 欧美吻胸吃奶大尺度电影 | 欧美人牲a欧美精品| 99精品视频在线播放观看| 国产乱国产乱300精品| 奇米一区二区三区av| 午夜欧美电影在线观看| 亚洲国产精品久久一线不卡| 日韩毛片高清在线播放| 国产精品乱人伦| 亚洲国产精品精华液2区45| 欧美成人精品1314www| 51精品久久久久久久蜜臀| 欧美日韩一区二区三区高清 | 91传媒视频在线播放| av亚洲产国偷v产偷v自拍| 岛国av在线一区| 高清在线不卡av| 国产盗摄一区二区三区| 国产精品综合视频| 丁香激情综合五月| 大胆欧美人体老妇| 91麻豆国产在线观看| 91色婷婷久久久久合中文| 91啪在线观看| 91麻豆精品秘密| 在线观看www91| 欧美欧美午夜aⅴ在线观看| 欧美日韩成人在线一区| 3d动漫精品啪啪一区二区竹菊 | 国产精品欧美久久久久无广告 | 一区二区日韩av| 亚洲国产日韩a在线播放性色| 亚洲精品菠萝久久久久久久| 亚洲午夜精品17c| 丝袜亚洲另类丝袜在线| 另类的小说在线视频另类成人小视频在线| 日韩电影在线观看电影| 激情文学综合网| 成人网男人的天堂| 欧美亚洲尤物久久| 日韩视频在线你懂得| 久久一日本道色综合| 国产精品三级av| 亚洲综合色自拍一区| 日本免费新一区视频| 国产麻豆精品久久一二三| 91在线视频播放| 777欧美精品| 中文一区二区在线观看| 亚洲综合在线电影| 精品午夜久久福利影院| eeuss鲁片一区二区三区在线看| 在线观看91视频| 欧美电影免费观看高清完整版| 中文字幕免费在线观看视频一区| 一区二区三区免费| 久久国产人妖系列| 色综合久久久久综合99| 欧美成人免费网站| 亚洲黄一区二区三区| 久久国产麻豆精品| 色激情天天射综合网| 精品日韩一区二区三区免费视频| 最新热久久免费视频| 麻豆精品一区二区| 99久久99久久精品免费观看| 日韩写真欧美这视频| 国产精品乱码人人做人人爱| 日韩影院在线观看| 不卡欧美aaaaa| 精品国产精品网麻豆系列| 一区二区三区四区视频精品免费| 精品夜夜嗨av一区二区三区| 日本乱人伦aⅴ精品| 精品国产乱码久久久久久图片| 亚洲女人小视频在线观看| 激情图片小说一区| 欧美日韩久久不卡| 中文字幕一区二区三区在线不卡| 另类欧美日韩国产在线| 欧美视频一区二区三区四区| 亚洲国产精品ⅴa在线观看| 天堂成人国产精品一区| 色欧美乱欧美15图片| 国产日韩欧美在线一区| 久久激情综合网| 欧美放荡的少妇| 亚洲欧美电影院| 成人精品小蝌蚪| 久久综合色鬼综合色| 亚州成人在线电影| 欧洲一区在线观看| 亚洲靠逼com| 福利视频网站一区二区三区| 精品嫩草影院久久| 日韩国产在线观看| 欧美日韩国产综合一区二区三区| 亚洲视频一区在线| av不卡在线观看| 国产精品高潮呻吟| 盗摄精品av一区二区三区| 久久久久久久综合狠狠综合| 欧美aaaaa成人免费观看视频| 91福利精品视频| 一区二区三区91| 欧美性猛片aaaaaaa做受| 亚洲三级在线观看| 色综合天天综合在线视频| 国产精品家庭影院| 99在线视频精品| 中文字幕第一区二区| 国产宾馆实践打屁股91| 国产农村妇女精品| 大胆亚洲人体视频| 欧美国产一区视频在线观看| 国产99精品视频| 国产三级精品视频| 成人伦理片在线| 国产精品久久久久精k8| av中文字幕在线不卡| ...xxx性欧美| 欧美日韩在线不卡| 日本一区中文字幕| 日韩欧美高清在线| 国产乱码一区二区三区| 日本一区二区三区dvd视频在线| 粉嫩aⅴ一区二区三区四区 | 久久久久久久久久久久电影| 精品无码三级在线观看视频| 久久天天做天天爱综合色| 国产成人亚洲精品青草天美| 国产精品乱码久久久久久| 91在线视频观看| 肉色丝袜一区二区| 欧美mv日韩mv亚洲| 国产成人av一区二区| 综合在线观看色| 欧美午夜精品免费| 蜜芽一区二区三区| 国产日韩欧美高清在线| 94-欧美-setu| 天天色 色综合| 国产亚洲精品7777| 色综合 综合色| 免费黄网站欧美| 国产精品视频第一区| 欧美伊人久久久久久午夜久久久久| 婷婷国产v国产偷v亚洲高清| 欧美mv日韩mv国产| 99精品视频在线观看免费| 天天综合天天做天天综合| 26uuu另类欧美亚洲曰本| 色综合久久久久| 久久超级碰视频| 亚洲男女毛片无遮挡| 欧美一区二区三区小说| 成人一区二区三区在线观看| 亚洲不卡av一区二区三区| 久久综合国产精品| 欧美性猛交xxxx乱大交退制版 | 爽好多水快深点欧美视频| 久久久精品一品道一区| 91国产丝袜在线播放| 狠狠v欧美v日韩v亚洲ⅴ| 亚洲欧美激情小说另类| 久久综合色鬼综合色| 欧美午夜宅男影院| 国产成人av影院| 免费在线观看一区二区三区| 成人欧美一区二区三区黑人麻豆| 正在播放亚洲一区| 91性感美女视频| 国产成人综合在线观看| 亚洲gay无套男同| 亚洲欧洲日韩综合一区二区| 日韩午夜在线影院|