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

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

?? os_time.c

?? 一個在44b0上移植成功的ucgui
?? 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)
{
    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.
*********************************************************************************************************
*/

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 = 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);
    }
}
/*$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
*********************************************************************************************************
*/

INT8U OSTimeDlyResume (INT8U prio)
{
    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                  */
    }
}
/*$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
*********************************************************************************************************
*/

INT32U OSTimeGet (void)
{
    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)
{
    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
樱花影视一区二区| aaa国产一区| 蜜桃久久精品一区二区| 亚洲成国产人片在线观看| 亚洲影院理伦片| 一区二区三区视频在线观看| 亚洲综合丝袜美腿| 亚洲午夜久久久久久久久久久| 亚洲激情第一区| 亚洲一区二区视频| 日本怡春院一区二区| 男女男精品网站| 激情综合网天天干| 懂色av中文一区二区三区| av一区二区三区在线| 欧美综合色免费| 26uuu久久综合| 久久精品人人做| 国产精品嫩草99a| 亚洲影院理伦片| 男人的j进女人的j一区| 国产成人在线影院| 色综合久久久久| 91精品国产综合久久福利软件 | 成人免费看的视频| www.av亚洲| 欧美亚洲高清一区二区三区不卡| 91精品国产91久久综合桃花| 精品国产免费视频| 国产精品美女久久久久av爽李琼 | 久久国产夜色精品鲁鲁99| 国产一区二区视频在线| 成人激情综合网站| 91久久精品网| 日韩欧美成人午夜| 1000部国产精品成人观看| 亚洲成人av免费| 国产综合色视频| 一本大道久久精品懂色aⅴ| 9191国产精品| 中文字幕精品综合| 婷婷久久综合九色国产成人 | 在线观看日韩av先锋影音电影院| 欧美精品tushy高清| 国产三级精品三级| 亚洲高清免费视频| 国产v日产∨综合v精品视频| 欧美日韩国产精选| 日本一区二区视频在线| 日韩国产在线观看| 97精品国产97久久久久久久久久久久| 777亚洲妇女| 亚洲视频电影在线| 国产一区欧美二区| 欧美日韩性生活| 国产精品久久久久国产精品日日| 五月天婷婷综合| 99精品久久只有精品| 精品欧美久久久| 亚洲风情在线资源站| 国产a区久久久| 91.com在线观看| 亚洲婷婷在线视频| 国产一区二区视频在线| 欧美高清性hdvideosex| 亚洲欧美福利一区二区| 韩国三级电影一区二区| 欧美日韩国产综合草草| 国产精品久久久久久久久果冻传媒 | 欧美一级欧美三级| 亚洲男人都懂的| 粉嫩av一区二区三区粉嫩| 精品免费视频.| 三级久久三级久久久| www.日韩av| 欧美国产日韩精品免费观看| 久久成人免费日本黄色| 欧美男生操女生| 一区二区高清视频在线观看| 成人免费视频一区二区| 久久久久亚洲综合| 青青草原综合久久大伊人精品| 欧美性受xxxx黑人xyx性爽| 国产精品免费免费| 粉嫩一区二区三区性色av| 久久噜噜亚洲综合| 国内久久精品视频| 91精品黄色片免费大全| 亚洲va在线va天堂| 欧美日韩成人一区二区| 亚洲黄色小视频| 日本福利一区二区| 亚洲精品免费播放| 色综合天天狠狠| 亚洲男人电影天堂| 91久久精品一区二区| 一区二区三区日本| 色偷偷88欧美精品久久久| 亚洲欧美激情一区二区| 色综合咪咪久久| 一区二区三区影院| 欧美性猛交一区二区三区精品| 亚洲综合一区在线| 欧美三电影在线| 日日摸夜夜添夜夜添国产精品| 欧美日韩国产高清一区| 日韩综合小视频| 91精品福利在线一区二区三区 | 国产在线精品国自产拍免费| 精品国产91亚洲一区二区三区婷婷| 美女视频黄 久久| 欧美成人三级在线| 久久国产麻豆精品| 国产亚洲成aⅴ人片在线观看| 国产盗摄一区二区三区| 国产精品毛片无遮挡高清| 99re66热这里只有精品3直播 | 成人午夜视频网站| 亚洲日本成人在线观看| 欧美在线播放高清精品| 日韩不卡手机在线v区| 精品嫩草影院久久| av激情亚洲男人天堂| 亚洲一区在线观看免费观看电影高清| 欧美日本国产视频| 国产在线一区观看| 亚洲同性gay激情无套| 欧美精品一二三| 国产专区欧美精品| 亚洲视频在线观看三级| 欧美日韩国产在线观看| 国内精品免费**视频| 亚洲日本韩国一区| 日韩一区二区三区在线| 国产成人av在线影院| 国产精品国产精品国产专区不片| 在线精品视频免费播放| 美腿丝袜一区二区三区| 久久久精品免费观看| 色8久久人人97超碰香蕉987| 青青草成人在线观看| 国产无人区一区二区三区| 色伊人久久综合中文字幕| 免费观看91视频大全| 亚洲天堂久久久久久久| 日韩美女在线视频| 91视频观看视频| 老汉av免费一区二区三区| 国产精品国产三级国产普通话99| 欧美日韩和欧美的一区二区| 国产福利不卡视频| 五月天婷婷综合| 国产精品美女久久久久高潮| 91黄视频在线观看| 国内久久精品视频| 午夜精品久久久久久不卡8050| 国产亚洲精品超碰| 欧美性猛交一区二区三区精品| 国产一区在线观看视频| 亚洲亚洲精品在线观看| 欧美韩国日本综合| 日韩午夜av一区| 色8久久人人97超碰香蕉987| 国产精品自拍一区| 免费观看久久久4p| 亚洲影院理伦片| 国产精品不卡在线| 精品久久久久久亚洲综合网| 欧美日韩一区二区电影| 91在线云播放| 国产成人鲁色资源国产91色综| 日本午夜精品视频在线观看| 一区二区三区四区国产精品| 精品国产伦一区二区三区观看方式| 精品视频免费在线| 一道本成人在线| 不卡av电影在线播放| 国产一区二区三区四区五区入口| 午夜精品国产更新| 伊人婷婷欧美激情| 中文字幕欧美国产| 国产欧美综合在线观看第十页| 日韩免费观看高清完整版在线观看| 欧美性色aⅴ视频一区日韩精品| av不卡一区二区三区| 国模套图日韩精品一区二区| 老司机免费视频一区二区三区| 午夜精品久久久久久| 亚洲福中文字幕伊人影院| 亚洲免费av高清| 亚洲精品久久久蜜桃| 亚洲欧洲性图库| 国产精品卡一卡二| 国产拍欧美日韩视频二区| 久久久久国色av免费看影院| www一区二区| 久久只精品国产| 久久久久久夜精品精品免费| 久久久久久久久久久电影| 欧美精品一区二区三区视频|