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

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

?? os_time.c

?? UCOS的源碼
?? C
字號(hào):
/*
*********************************************************************************************************
*                                                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    

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一卡二卡三卡| 欧美一区二区三区播放老司机| 99久久综合色| 欧美精品高清视频| 国产精品人成在线观看免费| 五月婷婷激情综合| 99久久婷婷国产综合精品| 日韩精品影音先锋| 亚洲午夜羞羞片| 成人黄色免费短视频| 日韩免费一区二区三区在线播放| 自拍偷拍亚洲综合| 福利91精品一区二区三区| 日韩亚洲欧美成人一区| 亚洲一区二区av电影| 成人免费看视频| 久久九九久久九九| 久久国产免费看| 777久久久精品| 亚洲国产视频一区| 日本道色综合久久| 综合色天天鬼久久鬼色| 国产高清成人在线| 久久久无码精品亚洲日韩按摩| 视频一区在线播放| 欧美裸体一区二区三区| 亚洲综合一区二区精品导航| 色哟哟一区二区在线观看| 国产精品久久久久永久免费观看| 国产盗摄一区二区| 精品国产乱码久久久久久牛牛 | 亚洲午夜羞羞片| 99免费精品在线观看| 成人免费在线视频| 色婷婷综合久久久中文一区二区 | 日韩欧美区一区二| 五月婷婷久久综合| 日韩一区二区三区在线| 日本aⅴ精品一区二区三区| 69精品人人人人| 日韩av一区二区在线影视| 4438成人网| 国内外精品视频| 欧美国产日韩精品免费观看| 成人激情校园春色| 亚洲精品大片www| 欧美日韩一区国产| 麻豆精品一二三| 久久久激情视频| 99综合影院在线| 亚洲不卡一区二区三区| 日韩欧美在线123| 国产麻豆精品95视频| 国产精品久久福利| 一本到不卡免费一区二区| 亚洲国产精品久久久久秋霞影院| 欧美日韩国产免费一区二区| 精品中文字幕一区二区小辣椒| 久久这里只有精品6| 91麻豆自制传媒国产之光| 亚洲成人第一页| 国产欧美一区视频| 欧美综合在线视频| 紧缚捆绑精品一区二区| 国产精品久久久久久户外露出 | 国产精品福利一区二区三区| 91久久精品国产91性色tv| 日本麻豆一区二区三区视频| 中文幕一区二区三区久久蜜桃| 在线欧美日韩国产| 国产精品一区二区久久精品爱涩 | 91香蕉视频污在线| 午夜精品福利一区二区三区av| 日日骚欧美日韩| 欧美区在线观看| 麻豆91在线播放免费| 欧美国产精品久久| 欧美精品在线观看播放| 高清久久久久久| 日本欧美在线看| 国产精品久线在线观看| 91精品国产麻豆国产自产在线| 国产福利一区二区| 日本少妇一区二区| 亚洲视频 欧洲视频| 精品久久一区二区三区| 色婷婷精品大视频在线蜜桃视频| 美国一区二区三区在线播放| 一区二区三区小说| 国产精品每日更新在线播放网址| 欧美人xxxx| 欧美专区亚洲专区| 成年人网站91| 精品一区二区三区免费视频| 欧美在线观看视频一区二区 | 久久精品一区蜜桃臀影院| 欧美伊人精品成人久久综合97| 国产自产2019最新不卡| 天天综合天天综合色| 国产精品免费丝袜| 久久天堂av综合合色蜜桃网| 欧美日韩高清一区二区不卡| 91电影在线观看| 99天天综合性| av电影天堂一区二区在线| 国产精品一区二区在线观看不卡| 久久精品99国产精品| 日韩二区在线观看| 日本成人在线看| 婷婷综合五月天| 日韩精品五月天| 日本成人在线电影网| 视频一区二区三区在线| 婷婷国产在线综合| 午夜不卡在线视频| 国产精品麻豆久久久| 日韩欧美国产系列| 国v精品久久久网| 成人av动漫网站| 91免费在线播放| 欧美日韩色一区| 精品美女被调教视频大全网站| 欧美精三区欧美精三区| 精品久久久久久亚洲综合网| xfplay精品久久| 一区二区三区毛片| 奇米精品一区二区三区四区| 亚洲免费观看视频| 亚洲国产成人午夜在线一区| 国产视频在线观看一区二区三区| 国产午夜精品一区二区三区嫩草 | 国产不卡在线一区| 福利电影一区二区三区| 91精品国产综合久久国产大片| 国产美女精品在线| 精品在线你懂的| 国产大片一区二区| www.av亚洲| 欧美日韩一区国产| 亚洲精品一区在线观看| 国产精品久久久久久久久快鸭| 亚洲少妇最新在线视频| 视频一区二区三区入口| 国产电影精品久久禁18| 91久久精品午夜一区二区| 欧美一区午夜视频在线观看 | 色综合天天综合网天天狠天天| 91黄色在线观看| 日韩欧美三级在线| 中文字幕一区免费在线观看| 亚洲va韩国va欧美va精品| 国产一区二三区| 一本色道亚洲精品aⅴ| 91精品国产全国免费观看| 国产亲近乱来精品视频| 亚洲国产日韩a在线播放性色| 捆绑紧缚一区二区三区视频| 不卡视频一二三四| 欧美一级黄色片| 综合激情成人伊人| 国产一区二区三区在线观看免费 | 蜜臀国产一区二区三区在线播放| 国产一区二区三区国产| 欧美亚洲一区二区在线观看| 2023国产精华国产精品| 亚洲自拍都市欧美小说| 国产超碰在线一区| 欧美成人r级一区二区三区| 亚洲人成网站精品片在线观看| 青青草国产成人99久久| 91成人免费电影| 国产日产欧产精品推荐色| 视频一区视频二区中文| 色综合天天性综合| 国产欧美精品日韩区二区麻豆天美| 亚洲一二三区在线观看| 本田岬高潮一区二区三区| 精品欧美乱码久久久久久| 亚洲mv大片欧洲mv大片精品| 91在线精品秘密一区二区| 26uuu欧美| 久久国产乱子精品免费女| 欧美日韩一区二区不卡| 亚洲欧美电影院| 成人黄色在线看| 国产女主播视频一区二区| 久久狠狠亚洲综合| 91麻豆精品国产自产在线 | 精品久久久久一区| 午夜精品在线看| 色8久久精品久久久久久蜜| 中文字幕av资源一区| 国产99久久精品| 337p粉嫩大胆色噜噜噜噜亚洲 | 亚洲精品高清在线| 不卡高清视频专区| 中文字幕不卡在线| www.欧美精品一二区| 国产精品久久久久影视| 东方欧美亚洲色图在线|