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

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

?? os_time.c

?? ucos-ii在C8051F020上的移植
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2001, 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)KCREENTRANT 
{
#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)KCREENTRANT
{
    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)KCREENTRANT
{
#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) == 0x00) {  /* 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)KCREENTRANT
{
#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)KCREENTRANT
{
#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一区二区三区免费野_久草精品视频
日韩专区欧美专区| 亚洲图片你懂的| 91国产成人在线| 91网页版在线| 99精品桃花视频在线观看| 大白屁股一区二区视频| 国产99精品视频| 97精品国产97久久久久久久久久久久| 国产成人超碰人人澡人人澡| 国产成人精品www牛牛影视| 国产大陆亚洲精品国产| 国产二区国产一区在线观看| 国产成人丝袜美腿| 99视频精品免费视频| 色哟哟国产精品免费观看| 欧美羞羞免费网站| 91精品国产91久久综合桃花| 日韩一区二区免费高清| 欧美成人r级一区二区三区| 欧美mv和日韩mv国产网站| 久久久国产精品不卡| 国产女人18毛片水真多成人如厕| 国产精品三级av在线播放| 亚洲久本草在线中文字幕| 亚洲第一福利一区| 极品少妇一区二区| www.亚洲激情.com| 欧美日韩久久一区二区| 日韩免费视频一区| 国产精品美女久久久久久2018| 中文字幕一区二区三区蜜月| 亚洲国产精品自拍| 国产自产v一区二区三区c| 91视频观看视频| 日韩一区二区不卡| 国产精品伦理在线| 首页国产欧美日韩丝袜| 成人美女在线视频| 欧美精品久久久久久久多人混战| 久久婷婷成人综合色| 亚洲理论在线观看| 国产一区二区三区在线观看免费 | 1024亚洲合集| 日韩中文字幕区一区有砖一区 | 国产精品嫩草99a| 亚洲444eee在线观看| 国产成人在线视频网址| 欧美美女一区二区三区| 国产精品三级在线观看| 美女视频免费一区| 日本道色综合久久| 欧美激情综合在线| 免费精品视频在线| 色噜噜夜夜夜综合网| 国产日韩精品一区| 日本中文字幕不卡| 色一情一伦一子一伦一区| 亚洲精品在线观看网站| 亚洲成人在线观看视频| 99精品在线免费| 国产欧美日韩不卡| 激情文学综合丁香| 91精品久久久久久久91蜜桃| 亚洲综合在线观看视频| jlzzjlzz亚洲日本少妇| 久久综合久久综合久久| 免费人成网站在线观看欧美高清| 欧美在线视频日韩| 亚洲乱码日产精品bd| 成a人片亚洲日本久久| 国产喂奶挤奶一区二区三区| 黄色日韩网站视频| 欧美大片在线观看一区| 男人操女人的视频在线观看欧美| 欧美日韩一区二区三区四区 | 国产日韩av一区| 国产综合久久久久影院| 26uuu国产日韩综合| 久久99久久久欧美国产| 欧美二区在线观看| 天堂影院一区二区| 在线综合视频播放| 日本成人超碰在线观看| 日韩一级二级三级| 美女视频黄 久久| 欧美videos中文字幕| 寂寞少妇一区二区三区| 国产色一区二区| 成人黄色一级视频| 亚洲欧美日韩电影| 欧美网站一区二区| 日本不卡不码高清免费观看| 欧美一卡二卡三卡四卡| 国产一区二区三区四区在线观看| 国产亚洲成年网址在线观看| 成人午夜电影网站| 一区二区三区在线免费观看| 欧美日韩国产精品自在自线| 美女视频黄久久| 国产精品网友自拍| 91丝袜美腿高跟国产极品老师 | 日韩欧美一级精品久久| 国产精品一区二区不卡| 中文字幕视频一区| 欧美老女人第四色| 国产在线视频一区二区三区| 国产精品国产三级国产aⅴ入口 | 欧美色图第一页| 国产真实乱偷精品视频免| 国产精品国产三级国产aⅴ无密码| 日本韩国一区二区三区| 日韩avvvv在线播放| 国产欧美日本一区二区三区| 精品视频一区二区三区免费| 国产在线视视频有精品| 亚洲一区二区3| 久久新电视剧免费观看| 欧美在线观看视频一区二区 | 91蜜桃免费观看视频| 麻豆传媒一区二区三区| 久久久激情视频| 在线成人小视频| 成人综合在线网站| 秋霞午夜av一区二区三区| 中文字幕一区在线| 欧美岛国在线观看| 欧美自拍偷拍一区| 成人精品视频.| 免费久久99精品国产| 亚洲激情中文1区| 国产女人18毛片水真多成人如厕| 6080国产精品一区二区| 91一区在线观看| 国产成人精品aa毛片| 久久不见久久见免费视频7| 亚洲一区二区三区四区在线观看| 欧美国产乱子伦 | 一级中文字幕一区二区| 日本一区二区视频在线| 日韩精品在线一区二区| 欧美日韩视频在线第一区| 91色.com| 91网上在线视频| 波多野结衣在线一区| 国产福利不卡视频| 国内精品自线一区二区三区视频| 青青草91视频| 午夜激情一区二区三区| 亚洲大尺度视频在线观看| 玉足女爽爽91| 亚洲国产欧美日韩另类综合 | 日韩欧美一区电影| 91精品国产色综合久久不卡蜜臀| 欧美色视频一区| 欧美日韩mp4| 欧美另类变人与禽xxxxx| 欧美性猛片aaaaaaa做受| 色8久久人人97超碰香蕉987| 一本大道久久精品懂色aⅴ| 99久免费精品视频在线观看| 波多野结衣精品在线| 色综合天天综合网国产成人综合天 | 国产精品网站在线观看| 中文av字幕一区| 亚洲欧美日韩精品久久久久| 一区二区三区四区激情| 午夜电影一区二区| 免费看欧美女人艹b| 狠狠v欧美v日韩v亚洲ⅴ| 国产乱子轮精品视频| 懂色av中文一区二区三区| 99久久精品一区| 色视频一区二区| 欧美精品色一区二区三区| 日韩欧美中文字幕一区| 久久精品亚洲精品国产欧美kt∨| 国产欧美综合在线| 亚洲美女免费在线| 亚洲v中文字幕| 国产一区二区三区av电影| 成人av小说网| 欧美日本一道本在线视频| 精品国产一区二区三区久久久蜜月| 亚洲精品一区二区三区蜜桃下载| 国产精品色哟哟| 午夜电影一区二区| 国产成人免费在线观看| 欧洲av在线精品| 久久夜色精品一区| 亚洲柠檬福利资源导航| 日韩国产在线一| 国产91露脸合集magnet| 欧美体内she精视频| 欧美精品一区二区久久婷婷 | 亚洲成人综合视频| 国产精品主播直播| 在线免费观看日本欧美| 久久久久久一二三区| 性做久久久久久久久| av电影在线观看一区|