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

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

?? os_time.c

?? uC/OS-II,The Real-Time Kernel, CORE FUNCTIONS, 80x86/80x88 Specific code (LARGE MEMORY MODEL)
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2003, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File : OS_TIME.C
* By   : Jean J. Labrosse
*********************************************************************************************************
*/

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


    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 (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);
    }
                                                 /* 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 MUST NOT call this function to resume a
*              task that is waiting for an event with timeout.  This situation would make the task look
*              like a timeout occurred (unless you desire this effect).  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
*********************************************************************************************************
*/

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


    if (prio >= OS_LOWEST_PRIO) {
        return (OS_PRIO_INVALID);
    }
    OS_ENTER_CRITICAL();
    ptcb = (OS_TCB *)OSTCBPrioTbl[prio];                   /* Make sure that task exist                */
    if (ptcb != (OS_TCB *)0) {
        if (ptcb->OSTCBDly != 0) {                         /* See if task is delayed                   */
            ptcb->OSTCBDly  = 0;                           /* Clear the time delay                     */
            if ((ptcb->OSTCBStat & OS_STAT_SUSPEND) == OS_STAT_RDY) {  /* See if task is ready to run  */
                OSRdyGrp               |= ptcb->OSTCBBitY;             /* Make task ready to run       */
                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);
        } else {
            OS_EXIT_CRITICAL();
            return (OS_TIME_NOT_DLY);                      /* Indicate that task was not delayed       */
        }
    }
    OS_EXIT_CRITICAL();
    return (OS_TASK_NOT_EXIST);                            /* The task does not exist                  */
}
#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)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    INT32U     ticks;


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


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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩视频不卡中文| 欧美影院午夜播放| 免费观看在线综合色| 亚洲欧美欧美一区二区三区| 亚洲色图制服丝袜| 中文字幕在线一区| 亚洲欧洲制服丝袜| 亚洲精品国产无套在线观| 亚洲精品国产a久久久久久 | 亚洲一区二区偷拍精品| 亚洲欧美日韩国产综合| 一区二区欧美国产| 亚洲国产wwwccc36天堂| 日韩一区精品字幕| 久久国产婷婷国产香蕉| 激情深爱一区二区| 成人午夜在线播放| 91福利视频久久久久| 欧美日韩综合一区| 日韩精品一区二区三区视频播放 | 国产福利一区二区三区视频在线 | 喷水一区二区三区| 国内精品嫩模私拍在线| 成人app在线观看| 欧美日本一道本| 国产日韩欧美不卡| 亚洲精品免费在线观看| 日本欧美一区二区| 成人精品亚洲人成在线| 欧美日韩一区二区电影| 久久久久综合网| 亚洲图片一区二区| 韩国成人在线视频| 色哟哟亚洲精品| 久久免费电影网| 日韩经典中文字幕一区| 国产精品白丝jk黑袜喷水| 日本韩国欧美国产| 久久综合99re88久久爱| 成人欧美一区二区三区视频网页| 日韩中文欧美在线| 91免费观看视频| 久久久噜噜噜久久人人看| 亚洲www啪成人一区二区麻豆| 丁香另类激情小说| 欧美一区二区精品| 一区二区三区中文字幕| 国产一二三精品| 91精品国产手机| 午夜私人影院久久久久| 成人免费看黄yyy456| 精品免费日韩av| 五月开心婷婷久久| av高清久久久| 久久久99精品久久| 奇米色一区二区三区四区| 欧美亚一区二区| 亚洲天堂成人网| 99久久久久久| 亚洲欧洲精品一区二区精品久久久| 老司机精品视频导航| 在线不卡一区二区| 亚洲一区二区三区四区在线观看 | 奇米888四色在线精品| 日本久久电影网| 亚洲欧美乱综合| 91蝌蚪国产九色| 亚洲欧洲成人av每日更新| 国产激情一区二区三区桃花岛亚洲| 精品国产乱子伦一区| 加勒比av一区二区| 日韩亚洲电影在线| 久久综合综合久久综合| 欧美videofree性高清杂交| 日本麻豆一区二区三区视频| 91精品一区二区三区在线观看| 亚洲成人动漫av| 在线播放日韩导航| 青草国产精品久久久久久| 666欧美在线视频| 久久99国产精品麻豆| 国产丝袜美腿一区二区三区| 国产高清精品在线| 国产精品久久久久毛片软件| 不卡视频免费播放| 亚洲综合一区二区| 538prom精品视频线放| 美腿丝袜一区二区三区| 日韩午夜小视频| 国产一区亚洲一区| 国产精品欧美久久久久无广告| 色婷婷综合久久| 视频一区二区国产| 日韩欧美国产成人一区二区| 国产电影精品久久禁18| 亚洲天天做日日做天天谢日日欢| 欧美三级日韩三级| 寂寞少妇一区二区三区| 国产精品久久久久久久久免费樱桃 | 亚洲精品在线三区| 成人永久免费视频| 亚洲色大成网站www久久九九| 欧美亚洲一区二区在线| 久久成人免费电影| 亚洲欧洲日产国码二区| 91精品国产综合久久久蜜臀粉嫩| 国内精品嫩模私拍在线| 亚洲欧美视频一区| 欧美不卡视频一区| 91黄色在线观看| 国产精品一级黄| 天堂资源在线中文精品| 日本一区二区综合亚洲| 欧美这里有精品| 国产一区999| 亚洲成av人综合在线观看| 国产午夜精品美女毛片视频| 欧美男人的天堂一二区| 国产91露脸合集magnet| 图片区小说区国产精品视频| 国产精品日韩成人| 欧美成人三级在线| 91小视频在线免费看| 国产一区视频在线看| 日韩高清不卡一区二区三区| 亚洲裸体xxx| 国产精品久久毛片av大全日韩| 日韩亚洲欧美中文三级| 欧美三级视频在线播放| 成人开心网精品视频| 国产在线一区二区| 丝袜美腿高跟呻吟高潮一区| 亚洲欧美日韩国产综合| www国产精品av| 欧美一区二区三级| 色婷婷久久综合| 色综合久久综合| 成人动漫中文字幕| 国产成人激情av| 高清在线不卡av| 国产成人日日夜夜| 精品一区二区三区在线播放视频| 青青草国产精品亚洲专区无| 日韩主播视频在线| 亚洲国产综合在线| 亚洲综合男人的天堂| 亚洲欧美日韩国产手机在线| 中文字幕欧美一| 中文字幕一区二区三区在线观看| 国产精品久久久久久久久搜平片| 国产精品沙发午睡系列990531| 久久精品在线免费观看| 国产视频亚洲色图| 国产日产亚洲精品系列| 久久蜜臀精品av| 久久精品人人做人人综合| 久久久午夜精品理论片中文字幕| 26uuu亚洲综合色| 久久精品人人做人人爽97| 国产欧美精品一区| 国产精品乱子久久久久| 中文字幕一区二区三区在线不卡 | 国产成人精品1024| 国产成人精品影视| 波多野结衣精品在线| 91久久国产最好的精华液| 欧美色综合天天久久综合精品| 欧美剧情电影在线观看完整版免费励志电影 | 欧美日韩精品一区二区三区蜜桃| 欧美精品色综合| 精品日韩成人av| 中文字幕精品综合| 亚洲美女在线一区| 无吗不卡中文字幕| 免费在线观看日韩欧美| 国产电影精品久久禁18| 色噜噜狠狠成人中文综合| 在线观看91av| 中文字幕一区视频| 天涯成人国产亚洲精品一区av| 韩国欧美国产1区| 91久久线看在观草草青青| 日韩一区二区在线观看视频播放| 国产日产欧美一区| 亚洲精品久久嫩草网站秘色| 激情欧美一区二区| 91视频在线看| 精品国产自在久精品国产| 亚洲欧洲一区二区三区| 免费观看在线综合色| 91美女片黄在线观看91美女| 91精品蜜臀在线一区尤物| 国产精品色一区二区三区| 丝袜亚洲精品中文字幕一区| 99r国产精品| 久久综合资源网| 偷拍与自拍一区| 99久久99久久精品免费观看| 精品欧美一区二区三区精品久久| 一片黄亚洲嫩模|