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

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

?? os_time.c

?? 在別處找到的一些uc/os-ii的一些資料
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2002, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* 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();
        OS_Sched();                                                       /* 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.
*********************************************************************************************************
*/

#if OS_TIME_DLY_HMSM_EN > 0
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 = (INT16U)(ticks / 65536L);        /* Compute the integral number of 65536 tick delays   */
        ticks = ticks % 65536L;                  /* Obtain  the fractional number of ticks             */
        OSTimeDly((INT16U)ticks);
        while (loops > 0) {
            OSTimeDly(32768);
            OSTimeDly(32768);
            loops--;
        }
        return (OS_NO_ERR);
    }
    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_DLY_RESUME_EN > 0
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) == OS_STAT_RDY) {  /* See if task is ready to run  */
                OSRdyGrp               |= ptcb->OSTCBBitY;             /* Make task ready to run       */
                OSRdyTbl[ptcb->OSTCBY] |= ptcb->OSTCBBitX;
                OS_EXIT_CRITICAL();
                OS_Sched();                                /* 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       */
        }
    }
    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_SET_EN > 0
INT32U  OSTimeGet (void)
{
    
    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_GET_SET_EN > 0
void  OSTimeSet (INT32U ticks)
{
    


    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}
#endif    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美妇女性影城| 26uuu亚洲综合色| 国产精品主播直播| 亚洲精品老司机| 久久精品一区二区三区不卡| 在线观看日韩高清av| 国产一区999| 日本成人在线不卡视频| 亚洲免费色视频| 久久新电视剧免费观看| 91精品欧美久久久久久动漫 | 69堂成人精品免费视频| 成人动漫精品一区二区| 狠狠色狠狠色合久久伊人| 夜夜精品浪潮av一区二区三区| 日本一区二区三区四区在线视频| 日韩一区二区三区在线| 一本久道久久综合中文字幕| 国产成人99久久亚洲综合精品| 日韩va亚洲va欧美va久久| 亚洲综合免费观看高清完整版在线| 国产亚洲午夜高清国产拍精品| 精品久久五月天| 日韩三级高清在线| 欧美日韩国产高清一区二区三区 | 欧美一级片免费看| 色久综合一二码| 97久久超碰国产精品电影| 国产精品 欧美精品| 九九**精品视频免费播放| 日韩高清在线观看| 五月天亚洲精品| 天堂在线亚洲视频| 亚洲高清在线视频| 午夜影院久久久| 亚洲福利国产精品| 亚洲国产毛片aaaaa无费看 | 亚洲免费在线视频一区 二区| 中文字幕不卡的av| 国产日韩欧美麻豆| 欧美激情一区三区| 中文字幕亚洲一区二区va在线| 日本一区二区三区在线不卡| 中文字幕国产一区| 中文字幕一区二区三| 亚洲欧美激情在线| 亚洲一二三级电影| 首页亚洲欧美制服丝腿| 三级久久三级久久久| 日欧美一区二区| 麻豆精品视频在线观看免费| 韩日精品视频一区| 福利一区福利二区| 成人黄色777网| 91久久国产综合久久| 欧美日韩精品电影| 精品国产91久久久久久久妲己| 欧美成人精品3d动漫h| wwwwww.欧美系列| 国产精品女上位| 亚洲综合成人网| 看电视剧不卡顿的网站| 国产成人自拍在线| 色婷婷综合久久久中文字幕| 欧美日韩一区视频| 精品欧美久久久| 国产精品久久久久7777按摩| 亚洲免费观看高清完整版在线| 性久久久久久久久| 国产精品一色哟哟哟| 色婷婷综合五月| 精品久久人人做人人爰| 欧美国产精品中文字幕| 亚洲一区自拍偷拍| 激情久久五月天| 99re亚洲国产精品| 欧美一区三区二区| 中文字幕不卡在线| 日本不卡一二三区黄网| 大胆亚洲人体视频| 精品视频全国免费看| 精品国产网站在线观看| 亚洲日本在线看| 久久99国内精品| 91麻豆文化传媒在线观看| 日韩欧美一区二区久久婷婷| 国产精品卡一卡二卡三| 日韩av不卡一区二区| 不卡视频免费播放| 日韩欧美中文一区二区| 亚洲日本一区二区| 国产乱码精品一品二品| 欧美撒尿777hd撒尿| 国产欧美视频在线观看| 日本伊人色综合网| 一本一道久久a久久精品综合蜜臀| 日韩亚洲欧美高清| 亚洲精品美国一| 福利一区福利二区| 精品毛片乱码1区2区3区| 一区二区三区精品久久久| 国产精品影视在线观看| 91精品在线免费观看| 亚洲欧美一区二区三区国产精品| 国产综合色精品一区二区三区| 欧美猛男超大videosgay| 欧美韩国一区二区| 精品一区二区三区免费毛片爱| 在线观看亚洲a| 亚洲视频你懂的| 国产成人自拍网| 日韩精品一区国产麻豆| 亚洲电影一级黄| 色呦呦日韩精品| 国产色综合一区| 久久er99热精品一区二区| 欧美久久一二区| 亚洲综合激情网| 欧美专区日韩专区| 亚洲精品综合在线| av不卡免费在线观看| 欧美国产综合色视频| 狠狠色狠狠色综合系列| 欧美电影免费观看高清完整版在 | 风流少妇一区二区| 久久伊人中文字幕| 国模娜娜一区二区三区| 日韩欧美的一区二区| 免费观看久久久4p| 欧美一区二区三区在线电影| 婷婷久久综合九色综合绿巨人| 欧美日韩一区二区在线视频| 亚洲一区二区不卡免费| 一本到不卡免费一区二区| 亚洲欧美日韩一区| 91色|porny| 亚洲黄色小说网站| 欧美日韩国产影片| 午夜伦欧美伦电影理论片| 日韩一区和二区| 久久99国内精品| 中文字幕免费观看一区| 成人免费电影视频| 亚洲精品欧美激情| 欧美视频一二三区| 三级在线观看一区二区| 欧美电影免费观看高清完整版在线观看 | 日韩和欧美一区二区| 欧美丰满嫩嫩电影| 麻豆91精品视频| 久久久久成人黄色影片| 成人免费的视频| 亚洲一区二区三区在线| 欧美二区三区的天堂| 天天色图综合网| 日韩一区二区免费视频| 国产精品一区二区在线看| 中文字幕欧美一区| 欧美日韩国产精选| 国产一区二区免费在线| 国产精品对白交换视频| 欧美性受xxxx黑人xyx性爽| 日本视频在线一区| 国产亚洲欧美中文| 91丝袜美女网| 日韩av一区二| 国产精品色哟哟网站| 欧美性大战久久久久久久蜜臀| 日韩精品一卡二卡三卡四卡无卡| 久久久久国产一区二区三区四区 | 亚洲日本在线看| 欧美一区二区三区视频在线| 国内精品免费**视频| **网站欧美大片在线观看| 欧美日韩一区二区欧美激情| 国产一区二区视频在线| 一区二区三区电影在线播| 日韩欧美精品在线视频| 成人av网站在线| 蜜桃av噜噜一区| 亚洲欧美欧美一区二区三区| 日韩视频在线你懂得| 91在线观看成人| 久久精品国产成人一区二区三区 | 亚洲国产精品影院| 精品欧美一区二区三区精品久久 | 日本aⅴ亚洲精品中文乱码| 国产欧美一区二区三区网站| 欧美午夜宅男影院| 国产精品小仙女| 丝袜a∨在线一区二区三区不卡| 久久久久久久一区| 欧美日韩在线免费视频| 国产91精品一区二区| 奇米色一区二区| 一区二区三区四区视频精品免费| 精品电影一区二区三区| 欧美性视频一区二区三区| 国产91丝袜在线观看| 日韩av在线免费观看不卡|