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

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

?? os_time.c

?? ucos移植到S3C2410上的代碼
?? C
字號(hào):
/*
*********************************************************************************************************
*                                                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

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美激情一区二区| 亚洲国产中文字幕| 欧美伊人精品成人久久综合97| 久久99精品视频| 亚洲另类在线制服丝袜| 久久色中文字幕| 欧美精品在线一区二区| 色婷婷久久久综合中文字幕| 国内成人自拍视频| 日韩激情av在线| 亚洲精品免费看| 欧美国产乱子伦| 精品国产乱码久久久久久久久| 欧美日韩三级一区| 91在线你懂得| 成人黄色大片在线观看| 精品系列免费在线观看| 视频一区免费在线观看| 一区二区高清免费观看影视大全| 欧美激情一区三区| 久久久久久一级片| 精品久久久久久久人人人人传媒| 欧美日韩成人在线| 欧美日韩精品一区二区在线播放| 色婷婷精品久久二区二区蜜臀av | 久久久影院官网| 91精品国产综合久久福利| 欧美三级乱人伦电影| 一本大道综合伊人精品热热| caoporn国产精品| 国产.精品.日韩.另类.中文.在线.播放 | 欧洲亚洲精品在线| 色综合天天性综合| 99久久国产综合精品女不卡| 成人午夜在线视频| 懂色中文一区二区在线播放| 大桥未久av一区二区三区中文| 国产在线精品免费| 国产麻豆视频精品| 成人深夜视频在线观看| 岛国精品一区二区| 91在线云播放| 色诱视频网站一区| 欧美性xxxxx极品少妇| 欧美专区亚洲专区| 91精品国产入口在线| 欧美一区二区三区日韩视频| 欧美一级午夜免费电影| www久久精品| 国产校园另类小说区| 国产精品天干天干在线综合| 国产精品乱人伦| 亚洲精品国产a久久久久久 | 欧美韩国日本不卡| 日韩美女精品在线| 亚洲高清三级视频| 蜜桃在线一区二区三区| 国产揄拍国内精品对白| 成人av片在线观看| 欧美视频在线播放| 日韩一区二区三区视频在线| 2023国产精品视频| 国产精品久久久久aaaa| 亚洲国产一二三| 麻豆久久一区二区| 国产二区国产一区在线观看| 99久久亚洲一区二区三区青草| 欧洲中文字幕精品| 欧美变态tickling挠脚心| 国产精品乱子久久久久| 亚洲午夜日本在线观看| 久久精品国产99久久6| 国产成人激情av| 欧美影视一区在线| 精品精品国产高清a毛片牛牛| 国产精品毛片久久久久久久| 午夜欧美电影在线观看| 久久国内精品自在自线400部| 粉嫩aⅴ一区二区三区四区| 欧美无砖专区一中文字| 精品久久久久久久人人人人传媒| 亚洲欧洲无码一区二区三区| 丝袜美腿亚洲一区| 国产盗摄一区二区| 欧美日韩在线电影| 国产丝袜在线精品| 偷拍一区二区三区| 成人性视频免费网站| 7777精品伊人久久久大香线蕉超级流畅| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 99国产欧美久久久精品| 欧美一区二区视频在线观看| 最新中文字幕一区二区三区 | 日韩电影免费在线| 91在线码无精品| 日韩视频免费观看高清完整版在线观看 | 久久网站最新地址| 亚洲成人av在线电影| 国产精品18久久久久久vr| 精品视频在线看| 国产精品的网站| 激情综合网av| 欧美日韩亚洲国产综合| 中文字幕在线不卡一区二区三区 | 美女在线视频一区| 色先锋资源久久综合| 国产欧美精品一区| 久久99最新地址| 91麻豆精品久久久久蜜臀| 自拍偷自拍亚洲精品播放| 国产在线视频一区二区| 91精品婷婷国产综合久久竹菊| 亚洲日穴在线视频| 国产mv日韩mv欧美| 精品少妇一区二区三区在线视频| 午夜av一区二区| 欧美在线免费播放| 亚洲免费av网站| 成人一区二区三区视频在线观看| 亚洲精品一区二区三区蜜桃下载| 婷婷国产在线综合| 欧美色欧美亚洲另类二区| 亚洲精品中文在线观看| 97精品国产97久久久久久久久久久久| 国产亚洲视频系列| 国产在线观看免费一区| www国产成人免费观看视频 深夜成人网| 日韩精品免费视频人成| 欧美精品第1页| 日本伊人午夜精品| 日韩女优毛片在线| 久久精品国产**网站演员| 欧美一级日韩一级| 日本vs亚洲vs韩国一区三区 | 久久精品欧美一区二区三区不卡| 国产在线视视频有精品| 精品国产99国产精品| 黑人巨大精品欧美一区| 久久精品亚洲乱码伦伦中文| 国产精品一二三| 国产视频一区在线观看 | 成人精品gif动图一区| 国产精品久久久久久久久免费丝袜| 国产成人av福利| 国产精品久久三| bt欧美亚洲午夜电影天堂| 国产精品国产三级国产普通话蜜臀 | 91精品欧美福利在线观看| 日韩国产精品大片| 日韩欧美在线123| 精品综合久久久久久8888| 久久综合狠狠综合久久激情| 国产精品一区二区三区网站| 亚洲国产高清不卡| 在线欧美日韩国产| 日韩和欧美的一区| 久久综合精品国产一区二区三区| 国产精品18久久久久久久网站| 国产精品进线69影院| 91福利在线看| 经典一区二区三区| 欧美激情一区在线| 91麻豆精品在线观看| 日日摸夜夜添夜夜添国产精品| 精品国产一区二区三区久久久蜜月| 国产美女精品在线| 亚洲精品国产第一综合99久久| 91麻豆精品国产91久久久更新时间 | 国产v日产∨综合v精品视频| 一区视频在线播放| 3d成人h动漫网站入口| 国产精品中文字幕日韩精品 | 精品美女被调教视频大全网站| 国产成人啪免费观看软件| 亚洲精选视频在线| 日韩视频免费直播| 色综合天天综合在线视频| 蜜臀久久99精品久久久久宅男| 中文幕一区二区三区久久蜜桃| 在线亚洲+欧美+日本专区| 极品少妇xxxx精品少妇| 亚洲免费av观看| 久久久久久久综合日本| 在线观看日韩av先锋影音电影院| 麻豆精品一二三| 一区二区三区欧美日韩| 久久久精品黄色| 欧美日韩国产乱码电影| av高清不卡在线| 精品亚洲免费视频| 亚洲一区二区在线播放相泽| 精品1区2区在线观看| 欧美午夜宅男影院| 国产69精品久久99不卡| 蜜桃久久av一区| 亚洲一区免费视频| 国产精品乱码人人做人人爱| 日韩美女一区二区三区四区| 欧美性生交片4| 成人黄色软件下载|