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

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

?? os_time.c

?? keil下單片機C8051F020的源程序
?? 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.
*********************************************************************************************************
*/

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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜三级在线| 久久久午夜精品| 国产自产高清不卡| 一区二区三区丝袜| 国产偷v国产偷v亚洲高清| 91精品国产入口| 91精品国产综合久久久久久久| 91免费国产视频网站| 国产又黄又大久久| 高清国产午夜精品久久久久久| 美日韩一级片在线观看| 免费高清视频精品| 毛片不卡一区二区| 奇米在线7777在线精品 | 欧美性受xxxx| 日韩精品电影一区亚洲| 色网站国产精品| av在线一区二区三区| 国产成人亚洲综合色影视| 精品在线播放免费| 免费高清在线一区| 国产又粗又猛又爽又黄91精品| 久久69国产一区二区蜜臀| 免费在线观看视频一区| 蜜臀av性久久久久蜜臀aⅴ四虎| 亚洲午夜视频在线观看| 日日嗨av一区二区三区四区| 国产精品国产精品国产专区不片| 久久久久久久久99精品| 久久久久国产精品人| 久久色中文字幕| 欧美大片顶级少妇| 欧美午夜影院一区| 26uuu亚洲综合色| 国产九色sp调教91| 欧美三级韩国三级日本一级| 国产精品污网站| 国产精品一区二区三区网站| 日韩欧美一区二区久久婷婷| 麻豆极品一区二区三区| 精品国一区二区三区| 激情五月激情综合网| 久久久久久久国产精品影院| 国产美女精品在线| 亚洲国产经典视频| 94色蜜桃网一区二区三区| 亚洲精品日韩综合观看成人91| 99re这里只有精品首页| 一区二区三国产精华液| 欧美精品1区2区| 美国十次综合导航| 国产精品美日韩| 91黄色免费看| 美洲天堂一区二卡三卡四卡视频 | 国产精品原创巨作av| 日本一区二区三区电影| av影院午夜一区| 亚洲成在人线在线播放| 欧美videofree性高清杂交| 国产91在线|亚洲| 亚洲蜜臀av乱码久久精品| 5月丁香婷婷综合| 国产91在线看| 偷拍自拍另类欧美| 国产亚洲成年网址在线观看| 色综合久久88色综合天天免费| 视频在线在亚洲| 国产精品视频一区二区三区不卡| 欧美综合久久久| 国产一区二区电影| 亚洲最大的成人av| 久久久久亚洲蜜桃| 在线亚洲高清视频| 激情偷乱视频一区二区三区| 国产精品欧美久久久久一区二区| 精品视频一区二区不卡| 欧美日韩一区二区三区免费看| 蜜桃av一区二区| 日韩美女视频19| 久久综合久久鬼色中文字| 91传媒视频在线播放| 国产精品正在播放| 日韩不卡在线观看日韩不卡视频| 国产精品不卡在线| 精品国产1区二区| 欧美亚洲一区二区三区四区| 精品一二线国产| 亚洲主播在线观看| 国产女主播一区| 91精品国产日韩91久久久久久| av不卡免费在线观看| 国产一区二区三区国产| 午夜一区二区三区视频| 中文字幕亚洲精品在线观看| 久久午夜羞羞影院免费观看| 欧美一级艳片视频免费观看| 欧美亚洲综合另类| 91女人视频在线观看| 高清shemale亚洲人妖| 蜜臀av性久久久久蜜臀aⅴ流畅| 亚洲午夜免费视频| 亚洲一区二区欧美| 日韩理论电影院| 亚洲日本丝袜连裤袜办公室| 中文一区在线播放| www国产精品av| 精品国产乱码久久久久久免费| 欧美日韩情趣电影| 在线观看亚洲a| 色视频欧美一区二区三区| 色综合色综合色综合| 99久久免费精品高清特色大片| 国产91丝袜在线播放0| 国产成人免费视频一区| 国产69精品久久99不卡| 国产精品69毛片高清亚洲| 国产在线视频不卡二| 黄色日韩三级电影| 国产乱码精品1区2区3区| 国产一区999| 国产精品18久久久久久久久 | 亚洲国产成人自拍| 国产精品久久久久久久午夜片| 国产精品丝袜久久久久久app| 久久久亚洲午夜电影| 国产精品久久久久久久久搜平片| 国产女人aaa级久久久级| 中文字幕日本乱码精品影院| 亚洲婷婷国产精品电影人久久| 国产精品不卡视频| 亚洲成精国产精品女| 日日摸夜夜添夜夜添精品视频 | 成人av在线电影| www.66久久| 欧美伊人久久久久久久久影院| 欧美二区乱c少妇| 久久精品人人做| 亚洲欧美精品午睡沙发| 日韩高清一级片| 高清shemale亚洲人妖| 91激情五月电影| 日韩精品一区二区在线| 久久久欧美精品sm网站| 一卡二卡欧美日韩| 奇米精品一区二区三区四区 | 中文一区二区完整视频在线观看| 国产精品久久久久久久久久免费看 | 日精品一区二区三区| 国产成人小视频| 欧美日韩高清在线播放| 久久久久99精品国产片| 亚洲色图一区二区| 美脚の诱脚舐め脚责91| 91麻豆免费视频| 精品美女一区二区三区| 亚洲九九爱视频| 国产乱码一区二区三区| 欧美日韩午夜精品| 中文字幕不卡在线| 男人操女人的视频在线观看欧美| jiyouzz国产精品久久| 日韩一区和二区| 亚洲图片另类小说| 国产风韵犹存在线视精品| 欧美人牲a欧美精品| 国产精品初高中害羞小美女文| 老司机精品视频在线| 色婷婷av一区二区| 中文字幕精品一区| 久久电影网站中文字幕| 色国产精品一区在线观看| 久久久久99精品一区| 秋霞午夜av一区二区三区| 色94色欧美sute亚洲13| 欧美韩国日本不卡| 国产一区中文字幕| 777久久久精品| 亚洲第一在线综合网站| 91一区二区三区在线观看| 久久综合色综合88| 蜜桃av噜噜一区| 欧美一区二区三区男人的天堂| 亚洲精品中文在线| 99久久精品国产一区| 国产三级久久久| 国产福利91精品一区| 久久综合狠狠综合久久综合88| 日韩高清欧美激情| 4438x成人网最大色成网站| 亚洲国产精品天堂| 色狠狠av一区二区三区| 亚洲丝袜自拍清纯另类| 不卡的av网站| 国产精品每日更新在线播放网址| 国产精品自拍网站| 久久九九久久九九| 黑人精品欧美一区二区蜜桃| 精品国产一区二区三区不卡| 久久精品国产成人一区二区三区| 欧美久久久久久蜜桃|