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

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

?? os_time.c

?? uCOSKeillpc22xx系統(tǒng)
?? 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
* Version : V2.76
*********************************************************************************************************
*/

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



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#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;



    cpu_sr = 0;                                                /* Prevent compiler warning             */
#endif    
    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) {
        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  = TRUE;                             /* Indicate PEND timeout                */
    } else {
        ptcb->OSTCBPendTO  = 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;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#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;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#endif    
    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}
#endif    

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av在线播放网址| 天天亚洲美女在线视频| av一本久道久久综合久久鬼色| 久久精品一区二区| 成人免费的视频| 亚洲成人精品影院| 日韩一本二本av| 国产精品一区在线观看你懂的| 国产亚洲美州欧州综合国| 成人美女视频在线观看| 一区二区久久久久| 日韩视频免费观看高清完整版 | 国产成人精品1024| 欧美国产精品v| 91浏览器在线视频| 日韩精品成人一区二区在线| 日韩三级免费观看| 成人精品视频一区二区三区| 亚洲狠狠丁香婷婷综合久久久| 在线观看亚洲精品视频| 日一区二区三区| 久久久99久久| 在线观看免费亚洲| 另类小说综合欧美亚洲| 国产精品欧美一区喷水| 欧美视频一二三区| 国产一区二区三区不卡在线观看| 国产精品污网站| 在线观看一区二区精品视频| 国模无码大尺度一区二区三区| 中文字幕一区二区三区不卡| 欧美高清hd18日本| 国产成人综合在线播放| 亚洲午夜羞羞片| 久久奇米777| 欧美日韩国产高清一区二区三区| 美女被吸乳得到大胸91| 中文字幕在线观看不卡| 日韩午夜激情电影| 日本韩国欧美三级| 国产一区二区三区四| 亚洲国产一二三| 国产精品女同互慰在线看| 欧美精品99久久久**| 99re66热这里只有精品3直播 | 国产亚洲一区二区三区四区| 在线日韩av片| 成人午夜免费av| 美国欧美日韩国产在线播放| 亚洲理论在线观看| 国产嫩草影院久久久久| 日韩午夜激情电影| 欧美日韩国产天堂| www.亚洲色图.com| 国内精品写真在线观看| 午夜精品久久久久久不卡8050| 国产片一区二区| 久久免费的精品国产v∧| 欧美精品黑人性xxxx| 欧美在线制服丝袜| 色噜噜偷拍精品综合在线| 成人免费毛片片v| 国产黄色91视频| 国产麻豆日韩欧美久久| 久久福利资源站| 免费在线看一区| 日韩精品国产精品| 三级久久三级久久| 一区二区三区日韩欧美精品| 国产精品久久夜| 国产精品三级视频| 国产欧美一区二区精品婷婷| 欧美videos中文字幕| 精品国产一区二区三区不卡| 欧美丰满少妇xxxbbb| 欧美性受极品xxxx喷水| 色妞www精品视频| 色婷婷国产精品| 在线中文字幕一区| 91久久精品一区二区| 91在线视频播放地址| 成人av动漫网站| 91色视频在线| 欧美系列亚洲系列| 欧美一区欧美二区| 日韩一区二区三区观看| 日韩午夜在线影院| 国产午夜亚洲精品午夜鲁丝片| 久久久一区二区三区| 国产精品久久久久久久久果冻传媒| 国产日韩成人精品| 亚洲视频小说图片| 亚洲第一福利一区| 美女免费视频一区| 懂色av噜噜一区二区三区av| 色综合天天综合给合国产| 91成人网在线| 日韩区在线观看| 国产女人18毛片水真多成人如厕| 国产精品久久福利| 亚洲国产人成综合网站| 热久久国产精品| 国产乱一区二区| 日本丶国产丶欧美色综合| 欧美日韩三级在线| 久久久久亚洲蜜桃| 亚洲欧美成人一区二区三区| 天堂成人国产精品一区| 国产激情视频一区二区三区欧美| 91亚洲精品一区二区乱码| 欧美酷刑日本凌虐凌虐| 亚洲精品一区二区三区影院 | 亚洲一级片在线观看| 欧美aaa在线| 成人av网在线| 制服.丝袜.亚洲.中文.综合| 久久免费电影网| 亚洲一区精品在线| 国产在线国偷精品产拍免费yy| 成人精品鲁一区一区二区| 欧美精品少妇一区二区三区| 26uuu国产电影一区二区| 亚洲日本va午夜在线电影| 免费精品视频在线| 99视频一区二区| 日韩精品资源二区在线| 亚洲婷婷国产精品电影人久久| 日本伊人精品一区二区三区观看方式| 国产一区日韩二区欧美三区| 欧美三级电影在线观看| 久久精品一区二区三区不卡牛牛| 亚洲综合区在线| 国产丶欧美丶日本不卡视频| 欧美色手机在线观看| 中文字幕第一区综合| 久久99精品久久久久久久久久久久| 91小视频免费看| 国产夜色精品一区二区av| 奇米四色…亚洲| 91国在线观看| 国产精品日日摸夜夜摸av| 久久精品国产精品亚洲红杏| 色婷婷av一区二区| 国产精品狼人久久影院观看方式| 蜜臀av在线播放一区二区三区 | 在线视频综合导航| 中文在线一区二区 | 国产日韩在线不卡| 久久精品国产久精国产| 欧美日产在线观看| 一区二区三区色| 99精品久久99久久久久| 中国av一区二区三区| 国产揄拍国内精品对白| 制服丝袜成人动漫| 日韩中文字幕亚洲一区二区va在线| 91福利在线观看| 一区二区三区在线观看视频| 不卡大黄网站免费看| 国产午夜精品福利| 国产成人精品一区二区三区网站观看 | 精品人在线二区三区| 日韩电影免费在线观看网站| 欧美中文一区二区三区| 亚洲永久免费av| 欧美影院一区二区| 亚洲一区二区三区在线| 欧美在线观看你懂的| 亚洲第一久久影院| 欧美色中文字幕| 亚瑟在线精品视频| 欧美日韩国产欧美日美国产精品| 亚洲综合av网| 欧美在线不卡一区| 亚洲国产aⅴ天堂久久| 一本一道久久a久久精品综合蜜臀| 中文字幕中文字幕在线一区| 成人动漫一区二区三区| 中文字幕在线观看一区二区| 一本大道久久精品懂色aⅴ| 亚洲一区在线电影| 91精品国产综合久久福利| 另类的小说在线视频另类成人小视频在线 | 亚洲欧洲色图综合| 欧洲精品一区二区| 日韩成人精品视频| 亚洲精品一线二线三线无人区| 国产激情一区二区三区桃花岛亚洲| 国产欧美一区视频| 欧日韩精品视频| 久草在线在线精品观看| 欧美激情资源网| 在线免费观看日本一区| 午夜精品123| 久久久久久麻豆| 色av成人天堂桃色av| 日韩精品一区第一页| 久久久777精品电影网影网| 成年人网站91| 首页国产丝袜综合|