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

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

?? os_time.c

?? keil mdk 3.22下移植的uCOS II 2.83
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2006, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_TIME.C
* By      : Jean J. Labrosse
* Version : V2.83
*********************************************************************************************************
*/

#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 (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_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.
*********************************************************************************************************
*/

#if OS_TIME_DLY_HMSM_EN > 0
INT8U  OSTimeDlyHMSM (INT8U hours, INT8U minutes, INT8U seconds, INT16U milli)
{
    INT32U ticks;
    INT16U loops;


#if OS_ARG_CHK_EN > 0
    if (hours == 0) {
        if (minutes == 0) {
            if (seconds == 0) {
                if (milli == 0) {
                    return (OS_TIME_ZERO_DLY);
                }
            }
        }
    }
    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);
    }
#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)milli + 500L / OS_TICKS_PER_SEC) / 1000L;
    loops = (INT16U)(ticks / 65536L);            /* Compute the integral number of 65536 tick delays   */
    ticks = ticks % 65536L;                      /* Obtain  the fractional number of ticks             */
    OSTimeDly((INT16U)ticks);
    while (loops > 0) {
        OSTimeDly((INT16U)32768u);
        OSTimeDly((INT16U)32768u);
        loops--;
    }
    return (OS_NO_ERR);
}
#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_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 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_PRIO_INVALID);
    }
    OS_ENTER_CRITICAL();
    ptcb = OSTCBPrioTbl[prio];                                 /* Make sure that task exist            */
    if (ptcb == (OS_TCB *)0) {
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);                            /* The task does not exist              */
    }
    if (ptcb == (OS_TCB *)1) {
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);                            /* The task does not exist              */
    }
    if (ptcb->OSTCBDly == 0) {                                 /* See if task is delayed               */
        OS_EXIT_CRITICAL();
        return (OS_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->OSTCBPendTO  = OS_TRUE;                          /* Indicate PEND timeout                */
    } else {
        ptcb->OSTCBPendTO  = OS_FALSE;
    }
    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_NO_ERR);
}
#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一区二区三区免费野_久草精品视频
亚洲午夜电影在线观看| 国产亚洲欧美日韩在线一区| 亚洲精品免费电影| 91福利视频在线| 亚洲国产精品久久久久婷婷884| 色一情一乱一乱一91av| 亚洲第一福利视频在线| 欧美男生操女生| 久久精品噜噜噜成人88aⅴ| 欧美一级视频精品观看| 国产老妇另类xxxxx| 国产欧美视频一区二区| 波多野结衣在线一区| 一区二区三区在线免费| 91精品国产综合久久精品性色| 久久99精品久久久久久动态图 | 91麻豆精品国产91久久久资源速度 | 亚洲高清久久久| 欧美高清精品3d| 精品在线播放免费| 日韩理论片一区二区| 5月丁香婷婷综合| 成人午夜碰碰视频| 亚洲bt欧美bt精品777| 26uuu精品一区二区在线观看| 国产高清亚洲一区| 亚洲在线成人精品| 久久毛片高清国产| 91福利小视频| 国产成人精品午夜视频免费 | 精品国产成人在线影院| 成人av片在线观看| 秋霞影院一区二区| 亚洲美女视频一区| 欧美成人女星排行榜| 99精品欧美一区二区三区小说| 日韩精品电影一区亚洲| 国产精品人成在线观看免费| 91精品国产手机| av一区二区三区黑人| 免费在线观看不卡| 一区二区三区国产| 国产欧美视频在线观看| 日韩精品一区二| 欧美在线观看你懂的| 国产成人免费av在线| 日韩在线a电影| 国产精品进线69影院| 亚洲精品在线免费观看视频| 在线精品视频免费观看| 成人免费高清在线观看| 久久se精品一区精品二区| 亚洲线精品一区二区三区八戒| 国产精品入口麻豆原神| 久久亚洲精华国产精华液| 欧美色视频一区| 97成人超碰视| 成人免费av网站| 国产精品自拍三区| 国产乱对白刺激视频不卡| 免费在线观看成人| 青青草视频一区| 舔着乳尖日韩一区| 亚洲h在线观看| 亚洲一区二区三区四区不卡| 国产精品乱码一区二区三区软件| 精品人在线二区三区| 欧美一级片在线观看| 欧美群妇大交群的观看方式| 色视频成人在线观看免| 99精品久久只有精品| 91社区在线播放| 91亚洲精品一区二区乱码| 99久久婷婷国产精品综合| 成人av综合在线| 91丨porny丨中文| 91亚洲精品久久久蜜桃| 色国产综合视频| 欧美在线视频你懂得| 在线观看免费视频综合| 欧美性色欧美a在线播放| 欧美日韩电影在线| 欧美日本国产视频| 日韩视频一区二区| 日韩精品一区二区三区四区视频| 日韩精品一区国产麻豆| 国产亚洲成av人在线观看导航| 日韩欧美国产成人一区二区| 精品国产sm最大网站| 欧美国产综合一区二区| 综合久久一区二区三区| 亚洲国产精品久久不卡毛片| 日日夜夜免费精品视频| 久久国产精品免费| 成人午夜在线免费| 欧美在线你懂的| 日韩三级免费观看| 亚洲免费毛片网站| 一二三四区精品视频| 日韩不卡一区二区| 国产在线精品一区在线观看麻豆| 国产高清不卡一区二区| 91丝袜美女网| 制服丝袜日韩国产| 久久精品亚洲精品国产欧美| 中文字幕在线一区免费| 亚洲va欧美va国产va天堂影院| 美脚の诱脚舐め脚责91| 波多野结衣一区二区三区| 欧美日韩中文字幕一区| 久久久亚洲精华液精华液精华液| 国产精品国产三级国产| 日韩精品色哟哟| 成人激情电影免费在线观看| 欧美三级电影在线观看| 精品99999| 亚洲小少妇裸体bbw| 国产一二精品视频| 欧美午夜一区二区三区免费大片| 精品国产伦一区二区三区观看方式| 亚洲国产成人午夜在线一区| 亚洲h精品动漫在线观看| 国产91综合一区在线观看| 欧美日韩精品一区二区| 国产精品黄色在线观看| 麻豆国产欧美日韩综合精品二区| 99re视频精品| 26uuu国产在线精品一区二区| 亚洲自拍偷拍av| 国产精品一级片在线观看| 欧美老女人第四色| 综合电影一区二区三区 | 亚洲国产精品传媒在线观看| 亚洲福利一二三区| aaa国产一区| 日韩欧美在线网站| 亚洲成人激情社区| 91激情五月电影| 久久久久久夜精品精品免费| 日韩国产精品久久久久久亚洲| av亚洲精华国产精华精| 久久精品一区二区三区不卡| 日韩av一二三| 欧美性大战久久久久久久 | 国产亚洲一区二区在线观看| 亚洲国产精品一区二区www| 99精品国产热久久91蜜凸| 国产亚洲一区字幕| 国产精品一区二区三区乱码| 日韩天堂在线观看| 欧美a级理论片| 欧美一区二区在线播放| 亚洲国产aⅴ天堂久久| 色综合中文字幕国产 | 国产亚洲一区二区三区四区 | 蜜臀av国产精品久久久久| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 麻豆91在线播放免费| 7777精品伊人久久久大香线蕉的| 亚洲色图制服丝袜| kk眼镜猥琐国模调教系列一区二区| 欧美不卡一区二区三区四区| 日韩一区精品字幕| 欧美精品123区| 天天av天天翘天天综合网| 欧美视频三区在线播放| 亚洲一区av在线| 欧美日韩一区二区电影| 午夜激情一区二区三区| 6080国产精品一区二区| 麻豆国产精品777777在线| 日韩精品一区国产麻豆| 国产最新精品免费| 欧美国产精品中文字幕| 99久久精品一区| 一区二区三区在线免费播放| 欧美日韩三级视频| 日本vs亚洲vs韩国一区三区二区| 日韩免费看的电影| 国产在线视视频有精品| 国产精品午夜电影| 色猫猫国产区一区二在线视频| 亚洲精品久久嫩草网站秘色| 欧美在线观看视频一区二区三区| 日韩综合在线视频| 欧美精品一区二区在线播放| 高清国产一区二区| 一区二区三区毛片| 欧美一区二区大片| 丁香五精品蜜臀久久久久99网站| 亚洲人成在线观看一区二区| 欧美乱妇15p| 国产一区91精品张津瑜| 亚洲精品免费视频| 日韩一区二区免费在线观看| 国产大片一区二区| 亚洲成av人片| 久久精品一区二区三区不卡| 在线欧美一区二区| 国产在线一区观看|