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

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

?? os_time.c

?? 移植ucos-II到mcs-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 *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一区二区三区免费野_久草精品视频
欧美日韩一区三区| 久久久精品黄色| 欧美精品一区二区在线播放| 久久久久久电影| 亚洲激情中文1区| 蜜臀av一区二区| 国产精品77777竹菊影视小说| 不卡一卡二卡三乱码免费网站| 欧美日韩亚洲国产综合| 日韩丝袜情趣美女图片| 自拍偷拍欧美激情| 毛片av一区二区| 欧洲精品在线观看| 久久久久免费观看| 日韩电影一二三区| 91亚洲精华国产精华精华液| 日韩精品专区在线影院观看| 亚洲人成网站色在线观看| 久久精品国产在热久久| 91久久香蕉国产日韩欧美9色| 久久综合色播五月| 亚洲成年人网站在线观看| 国产精品亚洲专一区二区三区 | 一卡二卡三卡日韩欧美| 亚洲综合视频网| 国产成人精品免费| 欧美一区二区三区视频| 伊人一区二区三区| 国产精品资源站在线| 欧美一区二区在线观看| 亚洲国产aⅴ成人精品无吗| 国产成人精品免费视频网站| 欧美午夜一区二区三区免费大片| 久久久久久麻豆| 蓝色福利精品导航| 欧美人与性动xxxx| 国产精品视频一区二区三区不卡| 麻豆精品久久久| 欧美午夜理伦三级在线观看| 中文字幕在线视频一区| 国产精品99久久久久久久vr| 精品久久久久一区二区国产| 午夜精品久久久久久久久久 | 成人免费视频网站在线观看| 欧美精品久久久久久久久老牛影院| 亚洲欧洲综合另类| 国产成人亚洲精品狼色在线| 久久综合久久综合久久| 日韩高清一区二区| 欧美一区二区三级| 五月天丁香久久| 日韩亚洲欧美在线| 久久99国产精品成人| 在线成人av网站| 日韩精品三区四区| 欧美一区二区三区视频在线观看| 日韩国产在线观看一区| 欧美一区二区网站| 久久激情五月激情| 国产亚洲污的网站| 成人免费毛片片v| 亚洲精品免费在线观看| 欧洲一区二区三区在线| 亚洲精品自拍动漫在线| 欧美日韩中文字幕一区| 蜜桃av一区二区| 久久这里只有精品6| 国产美女精品一区二区三区| 国产精品免费看片| 欧美亚日韩国产aⅴ精品中极品| 丝袜美腿一区二区三区| 精品久久人人做人人爱| 韩国v欧美v日本v亚洲v| 国产精品免费人成网站| 欧美午夜一区二区三区| 久久se精品一区精品二区| 日韩一区二区免费视频| 国产成人精品免费在线| 一区二区三区视频在线看| 欧美精品成人一区二区三区四区| 另类人妖一区二区av| 中文字幕在线播放不卡一区| 欧美欧美午夜aⅴ在线观看| 国产一区二区美女| 亚洲欧美另类小说| 欧美精品日韩一区| 国产91综合网| 亚洲国产日韩av| 中文字幕成人网| 青青草91视频| 欧美一区二区在线播放| 色综合天天在线| 成人精品视频一区| 国内精品不卡在线| 老鸭窝一区二区久久精品| 亚洲伊人伊色伊影伊综合网| 国产精品久久久久毛片软件| 国产亚洲自拍一区| 欧美电影免费观看完整版| 欧美日韩一区 二区 三区 久久精品| 国产精品99久久久久久有的能看 | 91女厕偷拍女厕偷拍高清| 国产精品一区二区91| 久久精品久久精品| 美日韩黄色大片| 天天亚洲美女在线视频| 亚洲成a人在线观看| 一区二区三区高清在线| 亚洲色图19p| 亚洲精品日韩综合观看成人91| 亚洲日本成人在线观看| 国产精品第四页| 亚洲天堂网中文字| 一区二区三区欧美亚洲| 亚洲综合清纯丝袜自拍| 亚洲伦在线观看| 一区二区三区不卡在线观看 | 久久精品国产亚洲aⅴ| 青娱乐精品视频| 美国毛片一区二区| 国产一区在线视频| 国产成人午夜高潮毛片| 成人手机电影网| 91国产成人在线| 欧美日韩另类国产亚洲欧美一级| 欧美精品一卡二卡| 精品国内二区三区| 国产日韩欧美精品电影三级在线| 国产婷婷色一区二区三区在线| 中文久久乱码一区二区| 中文字幕一区二区三区在线观看| 综合久久给合久久狠狠狠97色| 一区二区三区在线视频观看58 | 欧美一区日韩一区| 欧美精品一区二区三区蜜臀| 日本一区二区三区高清不卡| 亚洲色图都市小说| 日本亚洲视频在线| 国产精品911| 欧美在线视频全部完| 欧美精品777| 久久精品视频一区二区三区| 亚洲欧洲精品一区二区三区| 午夜伊人狠狠久久| 精品夜夜嗨av一区二区三区| 成人涩涩免费视频| 欧美日韩国产美| 久久久精品蜜桃| 亚洲一区在线观看网站| 极品瑜伽女神91| 欧美综合欧美视频| 久久精品夜色噜噜亚洲aⅴ| 亚洲人精品午夜| 久久99国产精品免费网站| 91视视频在线直接观看在线看网页在线看| 精品视频1区2区3区| 久久久久久日产精品| 亚洲大片精品永久免费| 国产一区二区美女| 欧美久久久一区| 一区精品在线播放| 美国精品在线观看| 在线观看免费视频综合| 国产视频911| 裸体歌舞表演一区二区| 91国偷自产一区二区开放时间| 久久亚洲综合色| 亚洲成人av电影| 91免费视频网址| 国产色综合一区| 久久精品噜噜噜成人av农村| 欧美午夜精品久久久| 国产精品少妇自拍| 国内不卡的二区三区中文字幕| 欧美吻胸吃奶大尺度电影 | 国产成人亚洲综合a∨婷婷| 欧美日韩国产系列| 国产精品传媒入口麻豆| 久久er99精品| 91精品黄色片免费大全| 亚洲人成网站在线| 波多野结衣视频一区| 久久久亚洲精品石原莉奈| 午夜精品久久久久久久99樱桃| 成人一区二区三区在线观看| 久久综合狠狠综合久久激情| 天天av天天翘天天综合网色鬼国产 | 成人综合激情网| 亚洲精品一区二区三区精华液 | 欧美变态口味重另类| 三级在线观看一区二区| 欧美色欧美亚洲另类二区| 一区二区三区中文字幕| 91免费小视频| 亚洲欧美偷拍三级| 97久久精品人人做人人爽50路| 国产精品毛片a∨一区二区三区| 国产精品影视在线观看| 久久综合国产精品| 丰满少妇久久久久久久 |