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

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

?? os_time.c

?? 在IAR EWARM開發(fā)環(huán)境下的ucos_2操作系統(tǒng)在LPC2200上的應(yīng)用
?? 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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产乱人伦偷精品视频免下载| 日韩欧美国产不卡| 高清国产一区二区| 国产精品女主播在线观看| www国产精品av| 精品久久久久久久久久久久久久久久久 | 国产欧美精品国产国产专区| 日韩精品在线看片z| 日韩欧美中文字幕制服| 日韩欧美国产小视频| 欧美变态tickling挠脚心| 精品理论电影在线| 欧美tickling挠脚心丨vk| 欧美大胆人体bbbb| 久久久久久久久久久久久夜| 久久在线观看免费| 国产精品久久久久7777按摩| 国产精品久久精品日日| 一区二区三区.www| 五月激情综合婷婷| 精品一区二区三区免费视频| 国产精品一区在线观看你懂的| 国产盗摄一区二区三区| 91同城在线观看| 欧美日韩三级在线| 日韩三级精品电影久久久 | 国内精品写真在线观看| 国产成人自拍网| 99re在线视频这里只有精品| 欧美写真视频网站| 精品福利一区二区三区| 国产精品高潮呻吟久久| 亚洲国产一区二区a毛片| 美日韩黄色大片| 成人激情开心网| 欧美片网站yy| 国产免费久久精品| 午夜电影一区二区三区| 丁香一区二区三区| 欧美撒尿777hd撒尿| 久久蜜桃一区二区| 一级精品视频在线观看宜春院 | 一区二区三区精品| 免费成人在线视频观看| 成人福利视频网站| 日韩视频国产视频| 亚洲综合一区二区| 国产suv精品一区二区883| 在线看一区二区| 国产欧美日韩另类一区| 午夜亚洲福利老司机| 高清免费成人av| 欧美不卡视频一区| 亚洲一区二区三区激情| 东方aⅴ免费观看久久av| 欧美一二三区在线| 亚洲成va人在线观看| 成人福利视频在线| 久久日韩粉嫩一区二区三区| 亚洲成人av一区二区三区| 国产白丝网站精品污在线入口| 欧美日本在线看| 亚洲精品美腿丝袜| 成人精品高清在线| 久久久99久久| 激情五月激情综合网| 欧美日韩一区三区四区| 亚洲视频每日更新| 成人精品视频一区二区三区 | 韩国女主播一区| 欧美一区二区在线免费播放| 一区二区三区自拍| 91视频精品在这里| 亚洲欧洲一区二区在线播放| 成人午夜视频网站| 国产精品美女一区二区在线观看| 狠狠色丁香久久婷婷综合丁香| 欧美久久高跟鞋激| 日韩精品亚洲一区二区三区免费| 亚洲精品在线网站| 亚洲六月丁香色婷婷综合久久 | 国产**成人网毛片九色 | 国产一区二区主播在线| 日韩欧美视频在线| 毛片不卡一区二区| 26uuu亚洲综合色欧美| 精品一区二区久久久| 欧美成人三级在线| 国产一区二区三区四| 久久九九久久九九| 不卡电影免费在线播放一区| 国产精品国产自产拍高清av王其| 成人午夜伦理影院| 亚洲欧美日韩在线| 欧美图片一区二区三区| 天天综合色天天| 精品少妇一区二区三区免费观看 | 国产欧美日本一区视频| 风间由美中文字幕在线看视频国产欧美| 欧美r级在线观看| 国产成人亚洲综合a∨猫咪| 国产精品区一区二区三区| 不卡一区二区中文字幕| 亚洲精品成人少妇| 欧美一区二区三区视频在线观看| 精品一区二区三区在线观看国产| 国产视频911| 91久久线看在观草草青青| 天天操天天色综合| 国产日韩三级在线| 99视频国产精品| 热久久一区二区| 国产欧美日韩精品在线| 色综合一个色综合亚洲| 天天影视色香欲综合网老头| 亚洲精品一区二区在线观看| 暴力调教一区二区三区| 亚洲国产人成综合网站| 久久久一区二区三区| 欧洲视频一区二区| 国产在线精品免费av| 一区二区三区不卡视频在线观看| 日韩欧美黄色影院| 一本久久精品一区二区| 狠狠色狠狠色综合系列| 一区二区三区四区亚洲| 久久婷婷久久一区二区三区| 91国偷自产一区二区开放时间| 久久精品国产免费看久久精品| 亚洲女同ⅹxx女同tv| 久久色成人在线| 欧美精品一二三区| 色婷婷精品大在线视频| 国产不卡在线一区| 久久国产精品露脸对白| 亚洲成人免费电影| 亚洲女同一区二区| 国产日韩精品一区二区浪潮av| 538在线一区二区精品国产| 97久久精品人人做人人爽| 国产一区二区三区在线观看免费视频 | 欧美电影一区二区三区| www.66久久| 国产69精品久久777的优势| 久久国产夜色精品鲁鲁99| 亚洲mv在线观看| 一区二区三区四区在线播放| 国产精品久久毛片| 国产精品欧美久久久久一区二区| 久久久精品一品道一区| 日韩欧美国产电影| 欧美成人女星排名| 日韩免费高清av| 日韩欧美国产一区在线观看| 欧美精品久久久久久久多人混战| 欧洲色大大久久| 欧美午夜在线一二页| 欧美偷拍一区二区| 欧美日本视频在线| 欧美日韩成人在线| 日韩三级精品电影久久久| 91精品免费在线| 日韩欧美自拍偷拍| 精品国产一区二区国模嫣然| 精品久久五月天| 久久久不卡网国产精品一区| 久久亚洲私人国产精品va媚药| 精品区一区二区| 久久婷婷国产综合精品青草 | 丰满岳乱妇一区二区三区| 国产1区2区3区精品美女| 丁香网亚洲国际| 99久久精品免费观看| 99久久国产综合精品色伊| 色综合色综合色综合色综合色综合| 色综合天天综合网天天狠天天 | 亚洲成a人在线观看| 亚洲高清不卡在线| 久久99精品久久久久久国产越南| 黄色日韩网站视频| 91丝袜国产在线播放| 欧美视频你懂的| 精品久久免费看| 综合久久久久久| 日本女人一区二区三区| 狠狠色丁香久久婷婷综| 91社区在线播放| 日韩一卡二卡三卡国产欧美| 国产视频一区在线播放| 亚洲欧美另类小说视频| 日本不卡中文字幕| 成人小视频免费在线观看| 欧美日韩在线不卡| 国产亚洲美州欧州综合国| 亚洲欧美日韩国产另类专区| 久久www免费人成看片高清| av亚洲精华国产精华精| 91精品久久久久久久99蜜桃| 中文一区二区在线观看| 丝袜诱惑亚洲看片|