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

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

?? os_time.c

?? uc/osII基于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
*********************************************************************************************************
*/

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 DT_XDATA *ptcb;


    if (prio >= OS_LOWEST_PRIO) {
        return (OS_PRIO_INVALID);
    }
    OS_ENTER_CRITICAL();
    ptcb = (OS_TCB DT_XDATA *)OSTCBPrioTbl[prio];                   /* Make sure that task exist                */
    if (ptcb != (OS_TCB DT_XDATA *)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一区二区三区免费野_久草精品视频
视频在线观看91| 91丨九色丨蝌蚪丨老版| 成人在线视频一区| 欧美日本韩国一区二区三区视频| 精品国偷自产国产一区| 亚洲国产中文字幕在线视频综合| 国精产品一区一区三区mba桃花 | 久久一区二区视频| 亚洲精品午夜久久久| 国产一区二区三区在线看麻豆| 欧美亚洲综合在线| 国产精品久久久久久久久免费丝袜| 视频一区在线播放| 色婷婷av久久久久久久| 国产精品免费免费| 韩国精品主播一区二区在线观看| 欧美日韩国产首页| 亚洲一二三区不卡| 91免费视频大全| 国产精品乱人伦| 国产一区二区三区四区五区美女| 在线不卡中文字幕| 午夜精品福利一区二区蜜股av| 99国产精品久久| 国产精品人妖ts系列视频| 国内精品第一页| 欧美电视剧免费全集观看| 婷婷久久综合九色综合伊人色| 日本韩国一区二区| 一区二区三区在线不卡| 97精品久久久久中文字幕| 国产精品久久久久桃色tv| 成人亚洲一区二区一| 中文字幕乱码久久午夜不卡| 高清不卡一区二区在线| 日本一区二区三区在线观看| 福利一区二区在线观看| 国产精品色婷婷久久58| 91免费在线视频观看| 亚洲一区二区三区在线看| 欧美三级资源在线| 蜜臀av一级做a爰片久久| 日韩欧美在线123| 狠狠色丁香久久婷婷综合_中| 精品国产三级电影在线观看| 国产麻豆9l精品三级站| 国产欧美综合在线观看第十页| 欧美最猛性xxxxx直播| 中文字幕在线不卡一区| 色琪琪一区二区三区亚洲区| 亚洲一本大道在线| 欧美一级生活片| 国产一区二区三区免费观看| 国产精品萝li| 在线精品视频小说1| 日本亚洲免费观看| 国产欧美一区二区三区鸳鸯浴| 成人黄页毛片网站| 亚洲成av人综合在线观看| 精品精品国产高清a毛片牛牛| 国产91精品一区二区麻豆亚洲| 亚洲视频一二三区| 欧美一区二区三区视频| 国产xxx精品视频大全| 亚洲综合在线观看视频| 精品伦理精品一区| 91在线porny国产在线看| 日韩有码一区二区三区| 久久精品欧美一区二区三区麻豆 | 91在线免费播放| 五月激情综合婷婷| 欧美激情一区三区| 欧美男男青年gay1069videost | 日韩手机在线导航| 成人av高清在线| 日韩精品五月天| 国产精品久久久99| 欧美xxxx在线观看| 在线免费观看日本欧美| 激情综合五月婷婷| 亚洲成a人v欧美综合天堂下载| 国产亚洲美州欧州综合国| 欧美性色欧美a在线播放| 国产美女娇喘av呻吟久久| 亚洲一级片在线观看| 欧美激情一区二区三区全黄| 欧美一区二区精品在线| 色视频成人在线观看免| 成人在线视频首页| 狠狠色丁香婷婷综合久久片| 五月婷婷激情综合网| 日韩理论片在线| 久久久九九九九| 欧美一区二区三区爱爱| 91福利国产成人精品照片| 成人性生交大片免费看中文 | 成人国产精品视频| 麻豆一区二区在线| 日韩电影在线免费观看| 夜夜精品视频一区二区| 国产精品欧美久久久久一区二区| 欧美成va人片在线观看| 欧美高清视频在线高清观看mv色露露十八| 成人av第一页| 丁香婷婷深情五月亚洲| 国产精品中文字幕一区二区三区| 日韩电影在线观看一区| 亚洲成人激情av| 亚洲综合在线观看视频| 一区二区三区四区激情| 亚洲日穴在线视频| 国产精品久久精品日日| 国产精品久久一卡二卡| 国产精品久久午夜夜伦鲁鲁| 欧美激情一区二区在线| 国产精品女主播在线观看| 国产欧美日韩三区| 国产精品久久影院| 亚洲人被黑人高潮完整版| 亚洲欧美电影一区二区| 一区二区三区欧美亚洲| 亚洲国产精品一区二区久久 | 久久亚洲精华国产精华液| 日韩精品一区二区三区四区| 日韩午夜电影av| 亚洲精品在线网站| 久久久久久久精| 国产欧美综合色| 综合分类小说区另类春色亚洲小说欧美 | 欧美一区午夜视频在线观看| 宅男噜噜噜66一区二区66| 欧美一级夜夜爽| 久久色在线视频| 国产精品久久久久一区| 一区二区三区美女视频| 视频一区在线视频| 国产精品一区免费在线观看| 成人激情免费视频| 欧美三级中文字幕| 精品国产髙清在线看国产毛片| 久久嫩草精品久久久精品一| 国产精品久99| 午夜精品久久久久久久99水蜜桃| 久久99日本精品| 北条麻妃一区二区三区| 欧美日韩国产a| 精品美女在线观看| 亚洲手机成人高清视频| 日本中文字幕一区二区视频| 国产精品亚洲一区二区三区妖精 | 91行情网站电视在线观看高清版| 欧美色图一区二区三区| 日韩一级片网址| 成人欧美一区二区三区1314| 首页综合国产亚洲丝袜| 岛国精品在线观看| 5月丁香婷婷综合| 中文字幕精品综合| 奇米777欧美一区二区| 99热在这里有精品免费| 日韩一区二区不卡| 亚洲精品免费一二三区| 久久国产生活片100| 91免费看片在线观看| 亚洲精品一区二区三区影院| 亚洲激情校园春色| 国产激情91久久精品导航| 欧美男人的天堂一二区| 国产精品免费看片| 久久国产精品第一页| 欧美综合视频在线观看| 欧美激情一区二区三区不卡| 日本女人一区二区三区| 日本精品一区二区三区四区的功能| 亚洲精品一区二区精华| 五月天婷婷综合| 99久久精品久久久久久清纯| 欧美tickling挠脚心丨vk| 亚洲电影激情视频网站| 99久久精品免费| 国产女人18水真多18精品一级做| 日本不卡一区二区三区| 91成人在线精品| av中文字幕不卡| 欧美日韩精品系列| 日韩精品专区在线影院观看| 一区二区三区在线播放| 国产成人精品影视| 日韩欧美国产综合| 天堂成人国产精品一区| 在线精品视频一区二区| 亚洲视频一区二区在线观看| 成人免费av在线| 久久精品人人做人人爽人人| 黄色日韩三级电影| 精品日韩一区二区三区| 免费看黄色91| 欧美一级淫片007| 蜜桃免费网站一区二区三区| 宅男噜噜噜66一区二区66|