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

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

?? os_time.c

?? ucos-ii 的完整代碼
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                              (c) Copyright 1992-2007, Micrium, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_TIME.C
* By      : Jean J. Labrosse
* Version : V2.86
*
* 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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品一区二区三区很污很色的| 免费人成网站在线观看欧美高清| 一区av在线播放| 国内精品视频一区二区三区八戒 | 久久se这里有精品| 91理论电影在线观看| 欧美精品一区二区三区蜜臀| 亚洲在线免费播放| 9i看片成人免费高清| 精品久久国产老人久久综合| 亚洲一区二区三区四区不卡| 99国产精品久久久久| 国产午夜精品福利| 国产在线观看免费一区| 欧美一激情一区二区三区| 亚洲成av人片观看| 91在线你懂得| 国产精品久久久久久久久动漫| 蜜桃av一区二区在线观看| 欧美乱妇15p| 亚洲国产精品久久不卡毛片| 色综合天天综合在线视频| 国产精品久久久久久久久久久免费看| 久久成人18免费观看| 欧美一卡2卡三卡4卡5免费| 亚洲bt欧美bt精品| 欧美色老头old∨ideo| 夜夜嗨av一区二区三区四季av| 成人av网站大全| 亚洲欧洲精品一区二区精品久久久| 国产自产v一区二区三区c| 欧美大片在线观看一区二区| 日韩不卡在线观看日韩不卡视频| 欧美日韩国产a| 日本亚洲最大的色成网站www| 777a∨成人精品桃花网| 日韩福利电影在线观看| 69堂成人精品免费视频| 久久精品久久精品| 精品第一国产综合精品aⅴ| 国内精品伊人久久久久影院对白| 欧美成人a在线| 国产99久久久精品| 亚洲欧美激情视频在线观看一区二区三区| 成人av网站在线| 亚洲综合清纯丝袜自拍| 欧美二区乱c少妇| 九九国产精品视频| 国产亚洲一区二区在线观看| 成人av动漫在线| 亚洲一二三级电影| 欧美一级精品在线| 成人黄色小视频| 亚洲bt欧美bt精品| 久久久久久一二三区| 91免费视频观看| 日韩高清在线一区| 欧美高清一级片在线观看| 色婷婷av一区| 激情综合色综合久久综合| 国产精品网友自拍| 欧美男同性恋视频网站| 国产一区二区电影| 亚洲精品网站在线观看| 欧美一二三区在线| 成人免费毛片片v| 无码av中文一区二区三区桃花岛| 欧美精品一区视频| 91黄色免费观看| 韩国午夜理伦三级不卡影院| 亚洲卡通动漫在线| 亚洲视频网在线直播| 欧美一级xxx| 日本道色综合久久| 国产精品亚洲视频| 日本va欧美va欧美va精品| 国产精品美女久久久久久2018 | 欧美一级精品在线| 99久久亚洲一区二区三区青草| 日韩精品亚洲专区| 中文字幕欧美日韩一区| 91精品免费观看| 91在线国产观看| 国产原创一区二区| 日韩av一级电影| 亚洲综合色在线| 中文字幕在线不卡视频| 久久亚洲影视婷婷| 日韩免费电影一区| 欧美剧在线免费观看网站 | 国产成人在线视频播放| 日韩黄色在线观看| 一区二区三区在线视频观看| 国产日韩欧美不卡在线| 欧美一级欧美三级在线观看 | 亚洲 欧美综合在线网络| 中文无字幕一区二区三区| 日韩丝袜美女视频| 欧美日韩视频专区在线播放| 不卡视频一二三四| 成人激情电影免费在线观看| 国产乱一区二区| 国内偷窥港台综合视频在线播放| 日韩福利视频导航| 五月激情综合婷婷| 午夜电影久久久| 亚洲国产视频一区| 亚洲一区二区精品久久av| 亚洲日本在线天堂| 一区免费观看视频| 亚洲欧美一区二区三区国产精品| 欧美激情一区二区三区| 国产日产欧美一区| 国产精品欧美精品| 中文字幕亚洲一区二区va在线| 国产精品久久久久久久久免费相片| 久久久99精品免费观看| 久久久久久99精品| 国产精品天美传媒沈樵| 成人欧美一区二区三区视频网页 | 激情综合亚洲精品| 国内一区二区视频| 福利电影一区二区三区| 成人av网站在线观看免费| 色综合久久综合| 欧美精品一卡两卡| 欧美mv日韩mv| 国产精品污污网站在线观看| 亚洲久本草在线中文字幕| 天天射综合影视| 国产中文一区二区三区| 国产成人av电影免费在线观看| fc2成人免费人成在线观看播放| www.亚洲国产| 欧美精品乱码久久久久久按摩| 91精品国产综合久久久久久久久久| 欧美一级免费大片| 国产精品日韩精品欧美在线| 一区二区欧美视频| 老司机精品视频在线| 成人avav影音| 欧洲精品中文字幕| 欧美xingq一区二区| 国产精品久久网站| 首页国产欧美日韩丝袜| 成人免费视频视频在线观看免费| 91精品91久久久中77777| 日韩欧美资源站| 亚洲婷婷在线视频| 久久爱另类一区二区小说| 不卡欧美aaaaa| 欧美精品 国产精品| 国产欧美日韩一区二区三区在线观看| 伊人婷婷欧美激情| 精品一区二区免费看| 91久久精品一区二区| 亚洲精品一区二区三区99| 亚洲综合一区二区| 粉嫩久久99精品久久久久久夜| 欧美日韩精品一区二区三区四区| 久久久久国产精品厨房| 日韩精品1区2区3区| 成人av片在线观看| 精品第一国产综合精品aⅴ| 亚洲国产成人va在线观看天堂| 高清av一区二区| 精品对白一区国产伦| 天天操天天干天天综合网| 91美女福利视频| 2020日本不卡一区二区视频| 一区二区欧美国产| 99精品视频在线观看免费| 精品国产一区二区三区久久久蜜月 | 亚洲成av人综合在线观看| 99麻豆久久久国产精品免费优播| 欧美大片日本大片免费观看| 夜夜嗨av一区二区三区中文字幕| 成人综合在线视频| 精品电影一区二区| 久久精品国产亚洲a| 欧美精品成人一区二区三区四区| 国产精品久久久久久久久免费樱桃| 国内成人精品2018免费看| 欧美一区二区在线播放| 亚洲成精国产精品女| 欧美性大战久久久| 亚洲免费在线观看视频| 成人一级片在线观看| 国产色91在线| 国产超碰在线一区| 亚洲国产精品二十页| 国产精品羞羞答答xxdd | 91麻豆精品国产91久久久久久| 亚洲欧洲在线观看av| thepron国产精品| 中文字幕一区在线观看视频| 成人黄页毛片网站| 亚洲欧美激情插| 欧美午夜一区二区三区| 亚洲亚洲精品在线观看|