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

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

?? os_time.c

?? 51下的一個操作系統源碼
?? 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
*********************************************************************************************************
*/
#if OS_Time_Dly_EN
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!    */
    }
}
#endif
/*$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_DlyHMSM_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_Time_DlyResume_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_Time_Get_EN
INT32U OSTimeGet (void)reentrant
{
    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_Set_EN
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一区二区三区免费野_久草精品视频
亚洲色图在线视频| 福利视频网站一区二区三区| 久久国产乱子精品免费女| 大胆亚洲人体视频| 在线综合视频播放| 成人欧美一区二区三区黑人麻豆| 日韩成人一区二区| 欧美亚洲一区三区| 亚洲国产精品ⅴa在线观看| 日韩高清一级片| 91美女片黄在线| 欧美高清在线视频| 精品亚洲国产成人av制服丝袜| 欧美在线啊v一区| 中文字幕亚洲视频| 高清在线观看日韩| 久久精品视频一区二区三区| 石原莉奈在线亚洲三区| 在线视频亚洲一区| 亚洲免费在线观看| 99re66热这里只有精品3直播 | 中文字幕在线不卡| 国内精品写真在线观看| 日韩欧美自拍偷拍| 日本在线不卡一区| 欧美一区二区三区视频在线| 亚洲午夜一区二区三区| 色视频一区二区| 中文字幕一区三区| 91一区在线观看| 亚洲人成影院在线观看| 99久久精品免费| ...av二区三区久久精品| a亚洲天堂av| 日韩毛片高清在线播放| 97久久精品人人做人人爽| 亚洲丝袜另类动漫二区| 色婷婷亚洲精品| 亚洲国产精品精华液网站| 欧美日产国产精品| 美国毛片一区二区| 2020日本不卡一区二区视频| 国产高清视频一区| 国产精品色在线观看| 成人黄色av网站在线| 中文字幕一区二区三区精华液| 成人动漫一区二区三区| 亚洲美腿欧美偷拍| 欧美久久久影院| 国产一区二区剧情av在线| 国产精品天天摸av网| 色偷偷久久一区二区三区| 亚洲高清不卡在线观看| 欧美tickling网站挠脚心| 国产mv日韩mv欧美| 亚洲综合在线五月| 欧美大黄免费观看| 不卡av在线免费观看| 一区二区三区国产豹纹内裤在线 | 99久久夜色精品国产网站| ●精品国产综合乱码久久久久| 欧美日韩中字一区| 国内精品自线一区二区三区视频| 国产精品视频yy9299一区| 欧美在线免费播放| 久久av资源网| 亚洲色图欧洲色图| 日韩精品一区二区三区swag | 韩国午夜理伦三级不卡影院| 亚洲国产成人在线| 欧美男同性恋视频网站| 国产盗摄一区二区| 亚洲午夜电影在线观看| 国产视频视频一区| 欧美人与性动xxxx| 成人不卡免费av| 日本中文字幕不卡| 国产精品久久久久久久午夜片 | 成人听书哪个软件好| 五月天精品一区二区三区| 久久先锋影音av鲁色资源网| 日本电影欧美片| 国产精品1区2区| 日韩av高清在线观看| 中文字幕在线一区免费| 欧美mv日韩mv亚洲| 欧美日韩一区二区三区在线| 成人丝袜视频网| 精品一区二区三区影院在线午夜| 亚洲激情在线激情| 国产精品午夜在线观看| 精品国产1区二区| 欧美日韩一区久久| 91视频国产资源| 成人高清视频在线观看| 激情综合一区二区三区| 亚洲成人午夜电影| 亚洲三级电影全部在线观看高清| 久久久影院官网| 精品国精品国产尤物美女| 欧美挠脚心视频网站| 色爱区综合激月婷婷| 成人精品免费看| 国产成人综合亚洲网站| 久久99热狠狠色一区二区| 天天免费综合色| 亚洲成人一区在线| 婷婷久久综合九色综合绿巨人 | 欧美韩国日本综合| 久久久夜色精品亚洲| www国产精品av| 精品国产一二三| 精品福利一区二区三区| 日韩精品一区二| 2023国产精品自拍| 久久伊人中文字幕| 久久精品免费在线观看| 久久欧美一区二区| 久久久精品国产免费观看同学| 精品999久久久| 久久久国产午夜精品| 久久久精品欧美丰满| 中文成人综合网| 国产精品成人免费在线| 亚洲欧美激情在线| 亚洲午夜久久久| 日韩电影免费在线| 国产一区二区三区蝌蚪| 成人免费毛片app| 91视频在线观看免费| 欧美亚洲综合一区| 欧美二区乱c少妇| wwww国产精品欧美| 国产精品亲子伦对白| 亚洲精选免费视频| 婷婷一区二区三区| 国产美女在线观看一区| 成人一区二区三区视频| 色88888久久久久久影院按摩 | 日本人妖一区二区| 国产又黄又大久久| 97se亚洲国产综合自在线| 欧美性极品少妇| 精品国产乱码久久久久久图片| 久久九九久久九九| 一区二区成人在线| 蜜臀av一区二区| 成人18视频日本| 91精品国产一区二区三区蜜臀 | 国产精品1024| 日本道色综合久久| 欧美成人三级电影在线| 中文字幕一区二| 蜜桃视频在线一区| 91小视频免费看| 精品国免费一区二区三区| 亚洲欧美成aⅴ人在线观看| 日本在线不卡视频一二三区| 粉嫩嫩av羞羞动漫久久久| 欧美自拍偷拍一区| 久久久久久久久久久黄色| 亚洲免费高清视频在线| 久久精品72免费观看| 99国内精品久久| 久久这里都是精品| 亚洲一区二区三区中文字幕| 国产精品亚洲第一区在线暖暖韩国 | av资源站一区| 精品久久久久香蕉网| 夜夜嗨av一区二区三区网页| 国产不卡视频一区| 91精品免费在线观看| 亚洲乱码国产乱码精品精可以看| 精品一区二区三区久久久| 欧美日韩三级一区二区| 国产精品灌醉下药二区| 国产一区二区在线影院| 337p亚洲精品色噜噜| 伊人色综合久久天天人手人婷| 国产精品资源在线| 日韩美女视频一区二区在线观看| 亚洲自拍另类综合| 99久久精品国产网站| 久久久久一区二区三区四区| 日韩不卡一区二区三区| 在线观看成人免费视频| 中文字幕一区二| 成人午夜大片免费观看| 国产日本欧洲亚洲| 国内精品伊人久久久久av影院| 91精品国产入口| 日韩国产精品大片| 69久久夜色精品国产69蝌蚪网| 亚洲女人****多毛耸耸8| 99在线热播精品免费| 中文字幕不卡的av| 成人a区在线观看| 国产精品久久久一区麻豆最新章节| 国产一区二区精品久久99| 久久久综合视频|