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

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

?? os_time.c

?? ucos-ii+lpc123x proteus emulate
?? 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一区二区三区免费野_久草精品视频
欧美高清激情brazzers| 日韩av在线播放中文字幕| 国产成人精品www牛牛影视| www久久久久| 国产在线精品不卡| 日本一区二区三区视频视频| 成人白浆超碰人人人人| 亚洲欧美另类久久久精品2019| 99热在这里有精品免费| 亚洲一区二区视频在线观看| 欧美日韩在线不卡| 麻豆精品一区二区综合av| 精品少妇一区二区三区| 成人动漫中文字幕| 亚洲一区二区三区免费视频| 日韩一卡二卡三卡| 国产91色综合久久免费分享| 亚洲四区在线观看| 欧美精品第1页| 国产成人欧美日韩在线电影| 亚洲精品美腿丝袜| 日韩一区二区精品在线观看| 高清视频一区二区| 亚洲综合在线观看视频| 欧美一级高清片| 成人免费毛片a| 亚洲综合丁香婷婷六月香| 91精品在线一区二区| 懂色av中文字幕一区二区三区| 亚洲色图欧美在线| 精品99999| 欧美在线免费观看亚洲| 国内精品久久久久影院一蜜桃| 亚洲人成网站在线| 欧美电视剧免费全集观看| 99国产精品国产精品毛片| 久久精品国产一区二区| 亚洲人快播电影网| 精品成人私密视频| 欧美亚州韩日在线看免费版国语版| 久久不见久久见免费视频1| 亚洲精品成人悠悠色影视| 精品电影一区二区三区| 精品视频在线看| youjizz久久| 婷婷国产v国产偷v亚洲高清| 国产三级三级三级精品8ⅰ区| 韩国一区二区视频| 亚洲色图欧美在线| 欧美xxx久久| 91久久精品国产91性色tv| 蜜乳av一区二区| 亚洲精品国产无天堂网2021| 欧美大片免费久久精品三p| 丁香啪啪综合成人亚洲小说| 日韩激情一区二区| 久久久精品免费观看| 欧洲一区二区三区在线| 国产成人h网站| 麻豆成人在线观看| 一区二区三区四区在线| 26uuu国产一区二区三区| 欧洲中文字幕精品| 九九视频精品免费| 亚洲一区在线观看视频| 中文幕一区二区三区久久蜜桃| 91精品国产黑色紧身裤美女| 99免费精品视频| 狠狠色丁香久久婷婷综合丁香| 亚洲综合清纯丝袜自拍| 国产精品国产三级国产普通话99 | 91精品国产色综合久久不卡电影 | 久久品道一品道久久精品| 欧美性淫爽ww久久久久无| 国产福利精品导航| 老司机免费视频一区二区三区| 天天免费综合色| 樱花草国产18久久久久| 中文字幕亚洲欧美在线不卡| 久久久久国产一区二区三区四区| 欧美另类一区二区三区| caoporm超碰国产精品| 国产精品亚洲视频| 国产在线精品一区二区三区不卡| 亚洲成va人在线观看| 亚洲综合一二区| 一区二区三区色| 伊人婷婷欧美激情| 久久久99精品久久| 国产精品乱人伦一区二区| 久久婷婷国产综合国色天香| 日韩欧美国产一区二区在线播放 | 极品销魂美女一区二区三区| 免费在线观看一区二区三区| 日精品一区二区| 香蕉久久一区二区不卡无毒影院| 一区二区三区免费| 亚洲一区二区视频在线| 亚洲图片欧美色图| 五月婷婷激情综合网| 亚洲第一激情av| 三级亚洲高清视频| 美国精品在线观看| 精品一区二区三区视频| 国产成人精品一区二区三区网站观看| 一区二区三区加勒比av| 久久久久久久综合色一本| 中文字幕亚洲在| 亚洲综合在线免费观看| 婷婷国产在线综合| 精品亚洲免费视频| 国产成人自拍网| av色综合久久天堂av综合| 色婷婷久久久久swag精品| 91久久精品网| 欧美成人猛片aaaaaaa| 91精品国产入口在线| 欧美精品一区二区三区一线天视频| 26uuu亚洲综合色| 综合分类小说区另类春色亚洲小说欧美 | 精品处破学生在线二十三| 日本一区二区成人在线| 一区二区三区日韩精品视频| 日本伊人色综合网| 懂色av一区二区在线播放| 欧美亚洲一区二区在线观看| 制服视频三区第一页精品| 精品国产乱码久久久久久闺蜜| 日韩精品一区二区三区视频| 亚洲欧洲制服丝袜| 老司机一区二区| 91亚洲午夜精品久久久久久| 欧美日韩亚洲高清一区二区| 久久影院视频免费| 亚洲美女免费视频| 麻豆精品视频在线观看视频| 国产成人av电影在线观看| 欧洲中文字幕精品| 久久亚洲精华国产精华液| 久久免费视频一区| 午夜久久福利影院| a美女胸又www黄视频久久| 日韩视频在线永久播放| 亚洲日本一区二区| 精油按摩中文字幕久久| 日本久久精品电影| 久久男人中文字幕资源站| 亚洲第一av色| 成人18精品视频| 国产女主播在线一区二区| 天堂在线亚洲视频| 91蜜桃在线观看| 久久久综合视频| 免费在线观看精品| 欧美性色黄大片| 综合自拍亚洲综合图不卡区| 国产乱色国产精品免费视频| 色综合天天综合狠狠| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 亚洲婷婷综合色高清在线| 精品一区二区成人精品| 欧美日韩一本到| 亚洲欧美偷拍卡通变态| 国产成人在线色| 精品国产免费人成电影在线观看四季| 亚洲国产一区视频| 成人黄色a**站在线观看| 精品国产一区二区三区av性色 | 亚洲少妇最新在线视频| 国产伦理精品不卡| 日韩欧美成人午夜| 丝瓜av网站精品一区二区| 在线视频一区二区免费| 综合网在线视频| 99精品1区2区| 欧美韩国日本综合| 风流少妇一区二区| 欧美激情在线观看视频免费| 精品一区精品二区高清| 91精品国产综合久久婷婷香蕉| 亚洲一区二区三区不卡国产欧美| 91日韩在线专区| 综合久久久久综合| 91丨九色丨国产丨porny| 国产日韩欧美麻豆| 国产99久久久国产精品潘金 | av日韩在线网站| 成人欧美一区二区三区小说| 成人成人成人在线视频| 国产精品二区一区二区aⅴ污介绍| 国产成人精品aa毛片| 国产精品久久一级| 99精品视频在线播放观看| 亚洲精品视频自拍| 欧美日韩中文字幕一区二区| 丝瓜av网站精品一区二区| 日韩午夜精品电影| 国产乱人伦偷精品视频不卡| 国产精品伦理在线| 色狠狠色噜噜噜综合网|