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

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

?? os_time.c

?? Turbo C 3.0 + UCOS2 + UCGUI PC學(xué)習(xí)版本
?? C
字號(hào):
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2002, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File : OS_TIME.C
* By   : Jean J. Labrosse
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#include "includes.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    


    if (ticks > 0) {                                                      /* 0 means no delay!         */
        OS_ENTER_CRITICAL();
        if ((OSRdyTbl[OSTCBCur->OSTCBY] &= ~OSTCBCur->OSTCBBitX) == 0) {  /* Delay current task        */
            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 || minutes > 0 || seconds > 0 || milli > 0) {
        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(32768);
            OSTimeDly(32768);
            loops--;
        }
        return (OS_NO_ERR);
    }
    return (OS_TIME_ZERO_DLY);
}
#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    

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲高清免费观看| 精品一区二区精品| 久久影音资源网| 99精品视频一区二区| 狠狠狠色丁香婷婷综合久久五月| 亚洲人成精品久久久久| 精品久久久久av影院| 欧美天堂一区二区三区| 丁香网亚洲国际| 青娱乐精品在线视频| 亚洲欧美日韩久久| 欧美国产一区在线| 欧美不卡123| 欧美日韩国产综合草草| 色视频欧美一区二区三区| 国产成人在线色| 日本中文在线一区| 亚洲一区在线电影| 国产精品理伦片| 国产欧美一区在线| www欧美成人18+| 日韩天堂在线观看| 欧美日韩和欧美的一区二区| 一本色道a无线码一区v| 成人一道本在线| 国产精品一区二区男女羞羞无遮挡| 日本美女视频一区二区| 午夜欧美2019年伦理| 亚洲一卡二卡三卡四卡无卡久久| 亚洲色图.com| 中文字幕一区二区三区色视频| 国产欧美视频一区二区| 久久久久国产一区二区三区四区| 精品88久久久久88久久久| 日韩欧美一级二级三级久久久| 精品视频在线免费观看| 欧美性极品少妇| 欧美亚洲愉拍一区二区| 欧亚洲嫩模精品一区三区| 在线视频国内自拍亚洲视频| 色激情天天射综合网| 在线视频国内一区二区| 色狠狠一区二区三区香蕉| 欧美午夜一区二区三区| 欧美日韩免费观看一区二区三区 | 欧美三级日韩三级| 一本色道久久综合亚洲91| 一本大道av伊人久久综合| 色伊人久久综合中文字幕| 在线一区二区视频| 欧美日韩一区二区三区在线看| 欧美日产国产精品| 日韩一区二区在线免费观看| 欧美白人最猛性xxxxx69交| 精品国产不卡一区二区三区| 久久久久久黄色| 亚洲欧洲一区二区在线播放| 亚洲九九爱视频| 天堂va蜜桃一区二区三区| 日韩国产欧美视频| 国产一区中文字幕| 成人做爰69片免费看网站| 一本在线高清不卡dvd| 欧美日韩国产一二三| 欧美一级二级在线观看| 久久久一区二区三区| 国产精品国产三级国产普通话99 | 色婷婷久久综合| 91九色最新地址| 欧美一级片在线| 中文一区二区在线观看| 亚洲精品国产无天堂网2021 | 爽好久久久欧美精品| 国内精品免费在线观看| 91丨porny丨户外露出| 欧美酷刑日本凌虐凌虐| 久久久九九九九| 亚洲一区在线电影| 国产另类ts人妖一区二区| 91在线观看美女| 欧美一级国产精品| 自拍视频在线观看一区二区| 美女视频免费一区| 91在线观看免费视频| 精品成人一区二区三区四区| 亚洲视频一区二区免费在线观看| 日韩中文字幕91| 成a人片亚洲日本久久| 欧美一区二区三区男人的天堂| 国产欧美视频一区二区三区| 日韩精品一级二级 | 亚洲成人免费电影| 成人综合婷婷国产精品久久蜜臀| 欧洲精品一区二区| 国产日韩欧美a| 秋霞午夜鲁丝一区二区老狼| 一本久久综合亚洲鲁鲁五月天 | 亚洲一区二区免费视频| 国产91富婆露脸刺激对白| 717成人午夜免费福利电影| 国产日韩欧美不卡在线| 日本成人在线视频网站| 色婷婷综合久久久久中文一区二区 | 精品黑人一区二区三区久久 | 国产精品久久久久久久久动漫 | 亚洲精品五月天| 国产综合色在线| 欧美日韩大陆一区二区| 国产精品久久久久影院| 久久国产免费看| 884aa四虎影成人精品一区| 一区二区三区四区不卡视频| 丁香婷婷综合激情五月色| 日韩精品中文字幕一区| 日本欧美在线看| 欧美三级视频在线播放| 亚洲最大的成人av| 不卡电影免费在线播放一区| www欧美成人18+| 美女视频网站久久| 欧美一区二区成人| 香蕉成人啪国产精品视频综合网| 色综合久久66| 亚洲精品视频自拍| 99久久国产免费看| 中文字幕一区二区日韩精品绯色 | 欧美精品乱码久久久久久按摩| 亚洲欧美国产77777| 成人黄色av电影| 国产精品另类一区| 成人网在线免费视频| 欧美激情在线观看视频免费| 丁香天五香天堂综合| 国产欧美精品一区| 高潮精品一区videoshd| 久久精品一区二区三区四区| 国产一区二区精品在线观看| 久久婷婷国产综合精品青草| 国产一区二区三区免费看 | 欧美伦理影视网| 五月天精品一区二区三区| 欧美精品国产精品| 久久精品久久精品| 久久嫩草精品久久久精品一| 国产精品一区在线| 欧美激情自拍偷拍| 色综合久久久久久久久| 亚洲国产精品一区二区久久| 欧美放荡的少妇| 久久精品国产亚洲a| 久久嫩草精品久久久精品| zzijzzij亚洲日本少妇熟睡| 亚洲人吸女人奶水| 欧美系列一区二区| 久久丁香综合五月国产三级网站| 久久免费偷拍视频| av高清久久久| 亚洲国产精品人人做人人爽| 日韩一区二区中文字幕| 国产成人在线影院| 亚洲精品美腿丝袜| 4438x亚洲最大成人网| 麻豆精品国产91久久久久久| 日本一区二区电影| 欧美视频你懂的| 久久精品国产99| 国产精品传媒在线| 欧美日韩中文字幕精品| 国产激情一区二区三区| 亚洲制服丝袜一区| 91麻豆精品国产91久久久使用方法 | 99久久国产综合精品麻豆| 亚洲mv在线观看| 久久久www成人免费毛片麻豆| 一本色道久久综合精品竹菊 | 91电影在线观看| 久88久久88久久久| 亚洲欧美日韩人成在线播放| 日韩三级在线观看| 94-欧美-setu| 蜜桃av一区二区在线观看| 亚洲欧洲国产专区| 日韩精品一区二区在线| 99精品久久只有精品| 理论片日本一区| 亚洲精品日韩综合观看成人91| 日韩一区二区视频| 一本一本大道香蕉久在线精品| 毛片基地黄久久久久久天堂| 成人免费在线视频| 26uuu亚洲| 欧美视频自拍偷拍| 99久久婷婷国产综合精品| 美女爽到高潮91| 亚洲国产精品欧美一二99| 国产精品电影一区二区| 日韩免费观看高清完整版| 在线看日本不卡| 成人app在线| 精品一区二区三区在线观看|