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

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

?? os_time.c

?? uC_OS-II在C51下的一個完整的LCD項目源碼
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                        (c) Copyright 1992-1998, Jean J. Labrosse, Plantation, FL
*                                           All Rights Reserved
*
*                                                  V2.00
*
* 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) reentrant
{
    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();
        OSSched();                                                        /* 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_TIMEDLYHMSM_EN
INT8U OSTimeDlyHMSM (INT8U hours, INT8U minutes, INT8U seconds, INT16U milli) reentrant
{
    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 = ticks / 65536L;                  /* Compute the integral number of 65536 tick delays   */
        ticks = ticks % 65536L;                  /* Obtain  the fractional number of ticks             */
        OSTimeDly(ticks);
        while (loops > 0) {
            OSTimeDly(32768);
            OSTimeDly(32768);
            loops--;
        }
        return (OS_NO_ERR);
    } else {
        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_TIMEDLYRESUME_EN
INT8U OSTimeDlyResume (INT8U prio) reentrant
{
    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)) {    /* See if task is ready to run              */
                OSRdyGrp               |= ptcb->OSTCBBitY; /* Make task ready to run                   */
                OSRdyTbl[ptcb->OSTCBY] |= ptcb->OSTCBBitX;
                OS_EXIT_CRITICAL();
                OSSched();                                 /* 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       */
        }
    } else {
        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_TIMEGETSET_EN
INT32U OSTimeGet (void) reentrant
{
    INT32U ticks;

    OS_ENTER_CRITICAL();
    ticks = OSTime;
    OS_EXIT_CRITICAL();
    return (ticks);
}

/*
*********************************************************************************************************
*                                            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
*********************************************************************************************************
*/

void OSTimeSet (INT32U ticks) reentrant
{
    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
视频一区在线视频| 精品国产自在久精品国产| 午夜免费欧美电影| 久久综合色一综合色88| 色综合视频一区二区三区高清| 色噜噜狠狠成人中文综合 | 精品久久久久一区| 粉嫩aⅴ一区二区三区四区| 午夜视频一区二区| 国产精品久久免费看| 欧美一区二区三区四区久久| av电影天堂一区二区在线| 美女尤物国产一区| 一区二区三区四区不卡视频| 久久久久久免费网| 正在播放亚洲一区| 欧美性色黄大片| 99国产精品国产精品久久| 国产一区二区三区免费看| 亚洲6080在线| 一区二区三区四区不卡在线 | 3d成人h动漫网站入口| aaa欧美色吧激情视频| 国产精品一区在线观看你懂的| 亚洲地区一二三色| 一区二区三区在线免费| 国产精品理论片| 国产午夜亚洲精品理论片色戒| 91精品国产综合久久香蕉麻豆| 色一区在线观看| 91免费精品国自产拍在线不卡| 国产精品亚洲第一区在线暖暖韩国| 人禽交欧美网站| 日韩精品一级中文字幕精品视频免费观看| 亚洲欧洲无码一区二区三区| 久久久亚洲精品一区二区三区| 日韩视频永久免费| 欧美精品欧美精品系列| 欧美午夜寂寞影院| 色先锋资源久久综合| 色综合天天性综合| 91免费视频观看| 一本一道久久a久久精品 | 欧美aaaaaa午夜精品| 午夜精品久久一牛影视| 午夜精品一区在线观看| 首页欧美精品中文字幕| 亚洲国产成人精品视频| 亚洲午夜国产一区99re久久| 一区二区三区免费看视频| 一区二区三区中文在线| 亚洲国产wwwccc36天堂| 亚洲成人免费看| 视频在线在亚洲| 久久精品99国产精品| 国产在线视视频有精品| 国产河南妇女毛片精品久久久| 国产成人在线视频网站| 成人激情开心网| 91欧美激情一区二区三区成人| 在线观看91视频| 在线成人av网站| 337p日本欧洲亚洲大胆色噜噜| 久久精品视频在线免费观看| 国产精品女同互慰在线看| 国产精品二区一区二区aⅴ污介绍| 综合分类小说区另类春色亚洲小说欧美| 国产精品灌醉下药二区| 一区二区三区在线看| 日韩精品一区第一页| 精品午夜久久福利影院| 成人少妇影院yyyy| 日本伦理一区二区| 日韩一级欧美一级| 国产精品免费av| 一区二区国产视频| 麻豆91精品91久久久的内涵| 国产精品88av| 91国偷自产一区二区三区成为亚洲经典 | 不卡电影一区二区三区| 91国偷自产一区二区开放时间 | 日韩一区二区三区免费看 | 美女视频一区二区| 成人综合在线观看| 欧美系列一区二区| 精品国产免费一区二区三区香蕉| 欧美激情综合网| 亚洲大片精品永久免费| 国产一区二区视频在线| 日本黄色一区二区| 精品国产一区二区精华| 亚洲精品菠萝久久久久久久| 精品一区二区影视| 一本大道综合伊人精品热热| 精品国产三级电影在线观看| 亚洲男人天堂av| 韩国女主播成人在线观看| 91小视频在线观看| 欧美精品一区二区三区在线播放 | 国产精品亚洲综合一区在线观看| 色噜噜狠狠色综合欧洲selulu| 日韩欧美激情四射| 精品国产三级a在线观看| 亚洲欧美日韩一区二区| 久久国产乱子精品免费女| 色综合天天综合网天天看片 | 中文字幕久久午夜不卡| 亚洲高清一区二区三区| 成人一级黄色片| 91麻豆精品国产91| 亚洲美女一区二区三区| 国产在线一区观看| 91精品国产综合久久久久久漫画| 亚洲欧洲精品一区二区精品久久久| 免费看欧美美女黄的网站| 色成人在线视频| 国产精品亲子伦对白| 精品无人区卡一卡二卡三乱码免费卡 | 午夜伊人狠狠久久| 91亚洲精品久久久蜜桃网站 | 国产亚洲精品资源在线26u| 天天综合网 天天综合色| 色综合中文综合网| 亚洲成人av免费| 亚洲国产wwwccc36天堂| 成人av免费在线| 精品成人佐山爱一区二区| 天天av天天翘天天综合网 | www..com久久爱| 久久综合久久综合亚洲| 日本视频免费一区| 欧美绝品在线观看成人午夜影视| 日韩美女视频一区| av在线综合网| 国产精品国产自产拍在线| 国产成人精品免费看| 国产亚洲综合av| 国产一二精品视频| 欧美成人r级一区二区三区| 日本成人在线看| 91麻豆精品国产91久久久| 99热精品国产| 国产精品久久777777| 成人中文字幕合集| 国产精品久久久久久久久免费丝袜| 国产成人在线色| 国产精品视频看| av一区二区久久| 日韩一区日韩二区| 一本大道久久a久久综合婷婷| 亚洲免费看黄网站| 欧美三级视频在线播放| 亚洲成人自拍一区| 欧美一区午夜视频在线观看| 免费久久99精品国产| 久久综合999| 丁香六月久久综合狠狠色| 国产精品九色蝌蚪自拍| 色综合久久天天综合网| 亚洲大片在线观看| 日韩久久久精品| 国产精品亚洲第一| 亚洲欧美一区二区三区久本道91 | 激情综合亚洲精品| 久久女同互慰一区二区三区| 国产69精品久久久久毛片| √…a在线天堂一区| 精品视频在线免费看| 蜜桃视频在线观看一区| 久久久久久一级片| 91啪在线观看| 奇米影视一区二区三区| 国产亚洲污的网站| 91国偷自产一区二区三区成为亚洲经典 | 欧美亚洲国产怡红院影院| 天堂影院一区二区| 久久久影视传媒| 色哟哟一区二区| 蜜桃在线一区二区三区| 国产精品网站导航| 欧美日韩视频第一区| 国产精一品亚洲二区在线视频| 亚洲欧洲国产日韩| 91精品国产色综合久久ai换脸| 国产成人一区二区精品非洲| 夜夜嗨av一区二区三区四季av| 欧美一级精品在线| 成人久久久精品乱码一区二区三区 | 青青草一区二区三区| 国产欧美精品在线观看| 在线视频一区二区免费| 精品一区二区成人精品| 亚洲精品乱码久久久久| 精品国产不卡一区二区三区| 91丨porny丨首页| 韩国午夜理伦三级不卡影院| 亚洲欧美另类在线| 精品国产凹凸成av人网站| 欧美性视频一区二区三区| 国产成人精品1024|