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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? os_time.c

?? ucos porting source for Am188
?? 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();
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区三区影视| 中文字幕一区二区三区不卡在线| 欧美哺乳videos| 国产精品久久久久久亚洲伦| 日韩高清不卡在线| 色综合亚洲欧洲| 久久午夜老司机| 天天免费综合色| 一本大道av一区二区在线播放| 精品国产乱码久久久久久牛牛 | 亚洲乱码国产乱码精品精小说 | 亚洲女人的天堂| 国产精品资源在线观看| 欧美日韩视频在线观看一区二区三区 | 69久久99精品久久久久婷婷| 亚洲少妇30p| 成人听书哪个软件好| 精品久久99ma| 美女www一区二区| 欧美人伦禁忌dvd放荡欲情| 亚洲男人的天堂av| 成人av在线网站| 国产精品妹子av| 国产成人在线视频网址| 久久久久久久久久电影| 国内精品自线一区二区三区视频| 欧美福利一区二区| 日韩国产在线观看| 欧美一区二区精品久久911| 亚洲福利视频三区| 欧美三级日韩三级国产三级| 亚洲自拍偷拍麻豆| 欧美三级中文字| 午夜av电影一区| 日韩亚洲欧美一区二区三区| 青青草原综合久久大伊人精品| 欧美久久久久久蜜桃| 午夜精品久久久久久久久| 欧美久久婷婷综合色| 偷拍一区二区三区| 日韩美女在线视频| 国产一二精品视频| 国产精品久久久久久久久快鸭| 成人av中文字幕| 一区二区三区在线观看动漫| 欧美探花视频资源| 日韩成人免费在线| 久久综合九色综合97婷婷| 国产不卡视频在线播放| 成人免费在线观看入口| 色婷婷亚洲综合| 天堂成人免费av电影一区| 精品久久久久99| 国产成人av自拍| 亚洲免费av在线| 欧美一区二区三区成人| 国产精品99久久久久| 亚洲色图欧洲色图| 欧美一区二区三区免费视频| 国产一区欧美日韩| 亚洲女同女同女同女同女同69| 欧美挠脚心视频网站| 国内精品国产成人| 日韩一区日韩二区| 一区二区三区在线影院| 一个色在线综合| 欧美丰满少妇xxxxx高潮对白 | av中文字幕在线不卡| 一区二区久久久久| 久久久亚洲午夜电影| 色综合久久88色综合天天6| 日本一不卡视频| 国产精品五月天| 在线播放欧美女士性生活| 国产成人精品免费一区二区| 亚洲第一成人在线| 中文文精品字幕一区二区| 欧美网站一区二区| 成人综合婷婷国产精品久久蜜臀 | 成人综合婷婷国产精品久久 | 中文字幕一区视频| 欧美一级日韩一级| 99久久99久久精品免费观看| 免费看欧美美女黄的网站| 国产精品不卡一区二区三区| 69久久夜色精品国产69蝌蚪网| 丁香婷婷综合五月| 免费在线观看成人| 一区二区三区欧美日| 国产午夜亚洲精品理论片色戒| 欧美少妇性性性| 成人黄页在线观看| 国产综合久久久久影院| 香蕉加勒比综合久久| 日韩一区在线免费观看| 久久久无码精品亚洲日韩按摩| 欧美日韩国产大片| 一本色道久久综合亚洲精品按摩| 黄色资源网久久资源365| 午夜精品一区二区三区电影天堂| 亚洲视频图片小说| 中文字幕巨乱亚洲| 久久一留热品黄| 日韩女优电影在线观看| 欧美老女人第四色| 欧美日韩亚洲综合在线| 色综合视频一区二区三区高清| 成人一区二区三区在线观看| 久久aⅴ国产欧美74aaa| 日本vs亚洲vs韩国一区三区| 亚洲成人av福利| 婷婷丁香久久五月婷婷| 亚洲电影一区二区三区| 一区二区欧美在线观看| 樱花影视一区二区| 亚洲精品乱码久久久久久黑人| 中文字幕亚洲一区二区va在线| 国产日韩欧美高清| 国产精品萝li| 综合色中文字幕| 亚洲男同性视频| 一区二区成人在线观看| 亚洲一区成人在线| 五月激情六月综合| 青青草原综合久久大伊人精品优势 | 欧美国产精品一区二区| 国产精品无圣光一区二区| 国产精品久久久久久久久免费丝袜 | 亚洲自拍偷拍综合| 视频一区欧美精品| 蜜臀av国产精品久久久久| 精品影院一区二区久久久| 国产精品中文字幕一区二区三区| 国产一区二区久久| 不卡av电影在线播放| 色呦呦日韩精品| 91精品国产美女浴室洗澡无遮挡| 精品久久久三级丝袜| 中文欧美字幕免费| 亚洲愉拍自拍另类高清精品| 男人的天堂久久精品| 国产精品99精品久久免费| 一本大道久久a久久精二百 | 日韩黄色在线观看| 国产在线麻豆精品观看| 99精品热视频| 日韩欧美一区二区在线视频| 亚洲一级在线观看| 国产成人a级片| 久久九九久久九九| 亚洲福利一二三区| 日本高清不卡视频| 久草这里只有精品视频| 亚洲小说欧美激情另类| 久久精品99国产精品日本| www.欧美.com| 欧美高清hd18日本| 国产精品视频线看| 青青草原综合久久大伊人精品优势| 国产精品正在播放| 欧美日韩一区小说| 欧美极品另类videosde| 日韩高清在线观看| av亚洲精华国产精华精| 91精品福利在线一区二区三区 | 一本色道久久综合狠狠躁的推荐| 有码一区二区三区| 中文字幕在线不卡国产视频| 日本网站在线观看一区二区三区| 国产成人精品亚洲午夜麻豆| 欧美日韩二区三区| 中文字幕视频一区| 国产精品影视在线| 91精品欧美福利在线观看| 亚洲品质自拍视频| 国产xxx精品视频大全| 欧美一区二区三区精品| 1000精品久久久久久久久| 精品在线播放免费| 欧美一区二区三区四区高清 | 欧美本精品男人aⅴ天堂| 一区二区三区加勒比av| 成人av高清在线| 久久久久久日产精品| 奇米影视一区二区三区| 欧美视频一区在线| ...中文天堂在线一区| 国产九色精品成人porny | 94-欧美-setu| 国产日产精品1区| 国内不卡的二区三区中文字幕| 欧美放荡的少妇| 日韩精品电影一区亚洲| 欧美日本一道本| 亚洲h精品动漫在线观看| 在线看一区二区| 亚洲综合清纯丝袜自拍| 色狠狠av一区二区三区| 亚洲欧美偷拍卡通变态| 色综合一区二区三区|