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

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

?? os_time.c

?? LPC2104/5/6嵌入式系統(tǒng)程序?qū)嵗?帶有PROTUES7.1仿真文件,適合做入門指導(dǎo)
?? 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    

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区福利视频| 亚洲欧洲日韩在线| 91成人国产精品| 成人激情免费视频| 成人性生交大片免费看视频在线| 热久久久久久久| 日韩电影免费一区| 天天做天天摸天天爽国产一区| 亚洲欧洲在线观看av| 久久久精品人体av艺术| 欧美亚洲综合色| 欧美男男青年gay1069videost| 91精品麻豆日日躁夜夜躁| 精品精品国产高清a毛片牛牛| 久久久国产精品麻豆| 一区在线中文字幕| 亚洲精品一线二线三线无人区| 久久久精品国产99久久精品芒果| 久久先锋资源网| 国产精品美女久久久久久久久| 国产精品毛片久久久久久久| 有坂深雪av一区二区精品| 午夜影院在线观看欧美| 久久精品国产99国产精品| 福利一区在线观看| 在线观看一区不卡| 久久综合色婷婷| 一区二区三区四区av| 久久爱www久久做| 91国偷自产一区二区三区观看| 欧洲精品中文字幕| 久久精品夜色噜噜亚洲a∨| 日韩理论片在线| 久久成人免费网站| 色天使久久综合网天天| 51久久夜色精品国产麻豆| 久久精品人人做| 亚洲午夜精品网| 国产成人夜色高潮福利影视| 色综合久久久久久久久久久| 日韩一区二区在线播放| 亚洲激情网站免费观看| 麻豆91免费观看| 一本大道久久a久久综合 | 亚洲6080在线| 另类的小说在线视频另类成人小视频在线 | 国产精品久久久久9999吃药| 日韩欧美亚洲另类制服综合在线| 精品国精品国产| 中文字幕一区二区在线观看 | 一本久久综合亚洲鲁鲁五月天 | 亚洲在线观看免费| 免费观看在线色综合| 国产寡妇亲子伦一区二区| 成人在线一区二区三区| 日韩欧美另类在线| 亚洲综合在线视频| 97se亚洲国产综合在线| 精品国产免费一区二区三区四区| 亚洲国产成人porn| 一本一本大道香蕉久在线精品| 欧美va日韩va| 久久99久久久久久久久久久| 色综合久久久久网| 亚洲精品国产无天堂网2021| 99久久精品国产麻豆演员表| 亚洲国产成人一区二区三区| 国产成人免费在线视频| 国产日韩欧美一区二区三区乱码 | 国产精品一区专区| 精品国产91亚洲一区二区三区婷婷 | 福利电影一区二区三区| 久久婷婷国产综合精品青草| 久久精品国内一区二区三区| 欧美精品日韩一区| 日韩精品1区2区3区| 99久久伊人精品| 日韩美女视频在线| 狠狠色丁香久久婷婷综合丁香| 日韩午夜精品视频| 国产一区二区在线观看免费| 精品国产乱码久久久久久免费 | 精品乱码亚洲一区二区不卡| 亚洲一区二区四区蜜桃| 国产一区免费电影| 91在线观看污| 一区视频在线播放| 亚洲激情校园春色| 成人深夜视频在线观看| 成人午夜电影久久影院| 99久久夜色精品国产网站| 久久久久综合网| 国产在线播放一区二区三区| 亚洲精品在线电影| 国产成人综合网| 欧美国产日韩精品免费观看| 成人一级黄色片| 一区二区三区四区亚洲| 蜜乳av一区二区三区| 国产欧美日韩亚州综合| 日本韩国欧美国产| 免费看欧美女人艹b| 国产午夜精品在线观看| 一本大道久久a久久精二百| 亚洲在线成人精品| 日韩丝袜情趣美女图片| 国产成人8x视频一区二区| 中文字幕在线一区二区三区| 在线观看亚洲成人| 奇米精品一区二区三区在线观看 | 亚洲综合色在线| 欧美日韩激情在线| 国产福利一区在线| 天天综合天天综合色| 久久综合狠狠综合| 色素色在线综合| 精品亚洲成a人| 亚洲一区二区精品视频| 久久午夜电影网| 欧美剧情电影在线观看完整版免费励志电影| 久草在线在线精品观看| 国产精品色噜噜| 日韩欧美一级在线播放| 成人动漫av在线| 免费成人在线观看| 中文字幕一区二区视频| 欧美精品欧美精品系列| youjizz国产精品| 免费人成精品欧美精品| 亚洲色图另类专区| 在线不卡欧美精品一区二区三区| 麻豆精品国产91久久久久久| 亚洲精品你懂的| 久久久91精品国产一区二区精品 | 91在线观看污| 国产99一区视频免费| 久久不见久久见免费视频1| 一区二区激情视频| 亚洲男人电影天堂| 欧美国产禁国产网站cc| 337p粉嫩大胆色噜噜噜噜亚洲| 欧美三区免费完整视频在线观看| 懂色av一区二区三区蜜臀| 国产最新精品免费| 国产一区久久久| 国产综合久久久久影院| 奇米888四色在线精品| 亚洲成人综合在线| 樱花影视一区二区| 久久这里只有精品首页| 欧美精品一区二区在线播放| 日韩一区二区免费在线电影 | 亚洲成人动漫av| 亚洲宅男天堂在线观看无病毒| 亚洲欧美日韩一区二区三区在线观看 | 精品视频一区二区三区免费| 99精品久久久久久| 99re免费视频精品全部| 成人黄色小视频| 国产一区二区三区香蕉| 福利一区福利二区| 99国内精品久久| 色88888久久久久久影院野外| 日本韩国欧美在线| 欧美日本国产视频| 日韩欧美国产综合| 久久精品日韩一区二区三区| 欧美经典一区二区| 亚洲日本在线a| 丝袜诱惑亚洲看片| 国产综合色产在线精品| 99热精品国产| 欧美亚洲另类激情小说| 欧美一区二区久久| 国产亚洲综合av| 日韩美女精品在线| 日韩国产欧美在线视频| 精品无人码麻豆乱码1区2区| 成人福利视频网站| 欧美日韩精品一区二区三区四区| 日韩欧美卡一卡二| 成人欧美一区二区三区视频网页 | 久久久久国产精品厨房| 国产精品三级电影| 亚洲综合成人在线视频| 日韩av二区在线播放| 日本不卡一二三| 国产九色精品成人porny| 成人av集中营| 成人免费观看男女羞羞视频| 91麻豆国产福利精品| 91精品国产91综合久久蜜臀| 国产亚洲精品中文字幕| 亚洲自拍偷拍网站| 国产精品1区2区| 欧美美女黄视频| 国产亚洲欧美在线| 亚洲一区二区三区在线播放| 亚洲一区二区三区视频在线播放| 国产一区二区调教|