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

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

?? os_time.c

?? 任務一 任務管理 任務二 優先級天花板 任務三 哲學家就餐 任務四 消息隊列 任務五 時鐘中斷
?? 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 OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    


    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)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    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)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    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)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    


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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
2021国产精品久久精品| 国产成a人亚洲| 99视频精品在线| 国产精品女同一区二区三区| 国产酒店精品激情| 中文字幕一区二区三区av| av电影天堂一区二区在线观看| 国产麻豆一精品一av一免费 | 国产精品久久久久久久久动漫| 成人午夜激情在线| 亚洲大片精品永久免费| 欧美精品18+| 亚洲一区二区三区四区在线| 欧美色老头old∨ideo| 国产日韩亚洲欧美综合| 偷拍与自拍一区| 欧美电影免费观看完整版| 亚洲无人区一区| 日韩视频免费观看高清完整版在线观看| 亚洲精品视频在线| 色婷婷一区二区三区四区| 亚洲精品一二三| 亚洲午夜久久久久久久久电影网 | 日韩欧美的一区| 欧美电视剧在线观看完整版| 亚洲精品一区二区三区影院| 国产成人精品亚洲午夜麻豆| 天堂成人免费av电影一区| 久久久777精品电影网影网 | 成人午夜免费视频| 色av一区二区| 国产 欧美在线| 色狠狠一区二区三区香蕉| 日韩一级完整毛片| 国产精品久久夜| 视频在线观看一区| 岛国av在线一区| 欧美精品三级日韩久久| 国产欧美日产一区| 日日夜夜免费精品| 成人黄色综合网站| 高清不卡一二三区| 欧美在线观看禁18| 欧美三级电影一区| 日本一区二区三区dvd视频在线| 亚洲亚洲人成综合网络| 国产一区啦啦啦在线观看| 欧美性生交片4| 日本高清不卡一区| 国产日韩精品久久久| 视频一区二区三区中文字幕| 成人美女视频在线观看| 日韩一区二区免费在线观看| 亚洲日本va午夜在线影院| 综合激情网...| 国产剧情一区在线| 日韩亚洲欧美在线观看| 一区二区三区在线视频免费观看 | 午夜电影一区二区三区| 成人精品小蝌蚪| 精品久久久久久久久久久久久久久| 欧美一卡二卡在线| 欧美电影精品一区二区| 视频一区二区三区在线| 欧美中文字幕一区二区三区| 国产精品无人区| 国产一区二区三区最好精华液| 欧美疯狂做受xxxx富婆| 亚洲午夜激情网页| 色欧美日韩亚洲| 亚洲激情综合网| 91日韩一区二区三区| 欧美日韩免费电影| 亚洲精品在线观| 激情综合色播激情啊| 懂色av中文字幕一区二区三区| 精品久久久久久久一区二区蜜臀| 日本系列欧美系列| 成人一级片网址| 国产亚洲美州欧州综合国| 国内精品自线一区二区三区视频| 日韩一区二区三区视频| 精品亚洲免费视频| 99久久er热在这里只有精品66| 欧美性猛交一区二区三区精品| 亚洲欧美偷拍三级| 国产伦精品一区二区三区免费迷| 日韩精品影音先锋| 国产福利一区二区三区视频| 国产免费成人在线视频| www.一区二区| 亚洲国产成人高清精品| 337p亚洲精品色噜噜狠狠| 亚洲国产成人在线| 麻豆精品在线视频| 91黄色小视频| 婷婷中文字幕一区三区| 欧美mv和日韩mv的网站| 成人激情视频网站| 亚洲精品国产第一综合99久久 | 国产农村妇女精品| 91麻豆.com| 视频一区二区三区在线| 26uuu色噜噜精品一区二区| 成人福利视频在线| 天堂影院一区二区| 国产拍揄自揄精品视频麻豆| 91久久精品一区二区三区| 日韩中文欧美在线| 亚洲国产精品t66y| 欧美喷潮久久久xxxxx| 国产伦精品一区二区三区免费| 亚洲视频综合在线| 日韩欧美美女一区二区三区| 懂色av中文字幕一区二区三区| 亚洲线精品一区二区三区| 欧美精品一区二区蜜臀亚洲| 91免费看视频| 国产精品99久久久久久似苏梦涵 | 尤物在线观看一区| 欧美电影免费观看高清完整版在| 91在线视频播放地址| 看片的网站亚洲| 欧美一区二视频| av午夜一区麻豆| 九九久久精品视频| 亚洲午夜在线电影| 中日韩免费视频中文字幕| 日韩午夜激情视频| 欧美在线视频全部完| 成人一区二区三区中文字幕| 麻豆成人久久精品二区三区小说| 中文字幕中文字幕一区二区| 日韩女同互慰一区二区| 欧洲亚洲精品在线| 色哟哟在线观看一区二区三区| 国产乱人伦偷精品视频免下载| 日韩在线一二三区| 亚洲国产成人高清精品| 一区二区三区四区蜜桃| 国产精品视频一二| 国产三级精品视频| 欧美一级xxx| 欧美一区二区视频网站| 欧美色精品在线视频| 欧美优质美女网站| 在线视频欧美精品| 欧美在线视频全部完| 欧美影院午夜播放| 欧美在线看片a免费观看| 91久久精品一区二区三| 色94色欧美sute亚洲线路一ni| www.欧美色图| 97精品国产露脸对白| av在线一区二区| av不卡在线观看| 91在线码无精品| 日本韩国欧美国产| 欧美日韩精品高清| 91精品国产欧美一区二区| 91麻豆精品国产91| 日韩欧美123| 久久五月婷婷丁香社区| 日本一区二区三区高清不卡| 欧美国产激情一区二区三区蜜月| 国产欧美日韩不卡| 亚洲免费色视频| 午夜av区久久| 精品一区二区综合| 福利一区二区在线观看| 91丨porny丨国产入口| 欧美在线999| 精品av久久707| 国产精品国产精品国产专区不片| 亚洲人成亚洲人成在线观看图片 | 欧美一区二区三区免费在线看| 91精品久久久久久久91蜜桃| 欧美tickling网站挠脚心| 国产亚洲精品超碰| 一区二区三区国产精华| 日韩激情视频网站| 粉嫩蜜臀av国产精品网站| 色菇凉天天综合网| 精品国产乱码久久久久久牛牛| 国产精品拍天天在线| 亚洲午夜久久久久久久久电影网| 久久精品国产精品青草| 不卡一区二区在线| 4hu四虎永久在线影院成人| 国产日韩影视精品| 午夜精品福利一区二区三区av| 国产专区综合网| 欧洲国内综合视频| 国产欧美一区二区精品秋霞影院| 亚洲精品乱码久久久久久久久| 麻豆免费精品视频| 欧美午夜精品一区二区三区| 久久精品一区四区| 日本中文在线一区| 色一区在线观看|