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

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

?? os_time.c

?? 最小的嵌入式操作系統
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2003, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_TIME.C
* By      : Jean J. Labrosse
* Version : V2.76
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#include <ucos_ii.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)
{
    INT8U      y;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#endif    
    if (ticks > 0) {                             /* 0 means no delay!                                  */
        OS_ENTER_CRITICAL();
        y            =  OSTCBCur->OSTCBY;        /* Delay current task                                 */
        OSRdyTbl[y] &= ~OSTCBCur->OSTCBBitX;
        if (OSRdyTbl[y] == 0) {  
            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 OS_ARG_CHK_EN > 0
    if (hours == 0) {
        if (minutes == 0) {
            if (seconds == 0) {
                if (milli == 0) {
                    return (OS_TIME_ZERO_DLY);
                }
            }
        }
    }
    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);
    }
#endif
                                                 /* 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((INT16U)32768u);
        OSTimeDly((INT16U)32768u);
        loops--;
    }
    return (OS_NO_ERR);
}
#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 can call this function to resume a
*              task that is waiting for an event with timeout.  This would make the task look
*              like a timeout occurred.  
*
*              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 or has been assigned to a Mutex.
*********************************************************************************************************
*/

#if OS_TIME_DLY_RESUME_EN > 0
INT8U  OSTimeDlyResume (INT8U prio)
{
    OS_TCB    *ptcb;
#if OS_CRITICAL_METHOD == 3                                    /* Storage for CPU status register      */
    OS_CPU_SR  cpu_sr;



    cpu_sr = 0;                                                /* Prevent compiler warning             */
#endif    
    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) {
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);                            /* The task does not exist              */
    }
    if (ptcb == (OS_TCB *)1) {
        OS_EXIT_CRITICAL();
        return (OS_TASK_NOT_EXIST);                            /* The task does not exist              */
    }
    if (ptcb->OSTCBDly == 0) {                                 /* See if task is delayed               */
        OS_EXIT_CRITICAL();
        return (OS_TIME_NOT_DLY);                              /* Indicate that task was not delayed   */
    }

    ptcb->OSTCBDly = 0;                                        /* Clear the time delay                 */
    if ((ptcb->OSTCBStat & OS_STAT_PEND_ANY) != OS_STAT_RDY) {
        ptcb->OSTCBStat   &= ~OS_STAT_PEND_ANY;                /* Yes, Clear status flag               */
        ptcb->OSTCBPendTO  = TRUE;                             /* Indicate PEND timeout                */
    } else {
        ptcb->OSTCBPendTO  = FALSE;
    }
    if ((ptcb->OSTCBStat & OS_STAT_SUSPEND) == OS_STAT_RDY) {  /* Is task suspended?                   */
        OSRdyGrp               |= ptcb->OSTCBBitY;             /* No,  Make ready                      */
        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);
}
#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)
{
    INT32U     ticks;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#endif    
    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;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#endif    
    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}
#endif    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品天干天干在观线| 99久久婷婷国产| 青青草伊人久久| 午夜视频一区在线观看| 国产精品久久看| 国产人久久人人人人爽| 国产精品免费久久久久| 中文字幕巨乱亚洲| 国产精品美女久久久久久| 亚洲三级在线播放| 亚洲aaa精品| 国产自产视频一区二区三区| 国产精品一二三四区| 成人app在线| 欧美日韩精品一区二区| 日韩区在线观看| 久久精品无码一区二区三区| 中文字幕精品一区二区精品绿巨人| 久久婷婷一区二区三区| 国产精品日日摸夜夜摸av| 伊人色综合久久天天人手人婷| 夜夜爽夜夜爽精品视频| 麻豆成人久久精品二区三区小说| 国模套图日韩精品一区二区 | 久久99国产精品麻豆| 成人av网站在线观看| 91精品国产综合久久久久久久久久 | 偷窥少妇高潮呻吟av久久免费 | 欧美福利视频一区| 久久精品在线观看| 免费成人小视频| www.性欧美| 久久久综合视频| 日韩黄色片在线观看| 在线亚洲高清视频| 欧美极品美女视频| 狠狠色丁香九九婷婷综合五月 | 国产精品色在线观看| 精品一区二区三区在线视频| 亚洲国产人成综合网站| 亚洲精品国产成人久久av盗摄 | 另类调教123区 | 91国偷自产一区二区三区成为亚洲经典| 91精品国产综合久久香蕉的特点| 亚洲风情在线资源站| 色婷婷国产精品| 亚洲一区二区视频在线| 在线视频国产一区| 免费久久99精品国产| 精品国免费一区二区三区| 亚洲电影在线免费观看| 欧美一区二区三级| 国产乱码精品一区二区三区忘忧草 | 日本一区二区三区四区在线视频 | 中文字幕一区二区三中文字幕| 亚洲人成电影网站色mp4| 97精品国产露脸对白| 国产人成亚洲第一网站在线播放| 卡一卡二国产精品 | 亚洲精品国产精品乱码不99| 91久久久免费一区二区| 亚洲国产精品影院| 国产亚洲欧美日韩在线一区| 在线一区二区观看| 男人操女人的视频在线观看欧美| 欧美精品一区男女天堂| 国产iv一区二区三区| 亚洲欧洲日韩av| 日韩欧美一区在线| 99久久久免费精品国产一区二区| 亚洲国产一二三| 中文成人综合网| 日韩区在线观看| 欧美日韩1区2区| caoporn国产一区二区| 国产精品99久久久久久久女警| 亚洲午夜激情网站| 国产精品午夜久久| 2024国产精品| 欧美日本乱大交xxxxx| 成人黄色777网| 国产美女精品人人做人人爽| 亚洲最大色网站| 亚洲久草在线视频| 国产精品久久久久久亚洲毛片| 欧美xxxxxxxxx| 91精品国产综合久久小美女| 一本色道久久综合亚洲精品按摩| 激情五月激情综合网| 日韩成人精品在线观看| 亚洲综合一区二区三区| 一区二区国产视频| 亚洲一区av在线| 亚洲精品国产无天堂网2021| 成人欧美一区二区三区| 一二三区精品福利视频| 美女诱惑一区二区| 日韩国产欧美三级| 精品在线免费观看| 久久66热偷产精品| 豆国产96在线|亚洲| 色呦呦国产精品| 欧美日韩精品一区二区三区 | 欧美亚日韩国产aⅴ精品中极品| 在线看不卡av| 精品久久久久久久人人人人传媒| 久久婷婷成人综合色| 亚洲欧美另类在线| 污片在线观看一区二区| 国产精一区二区三区| 色综合中文字幕国产| 99国产精品久久久久| 成人涩涩免费视频| av不卡在线播放| 欧美亚洲综合久久| 日韩欧美色综合| 136国产福利精品导航| 亚洲第一精品在线| 成人黄色小视频在线观看| 欧美系列日韩一区| 久久女同性恋中文字幕| 亚洲日本va在线观看| 久久99久久精品| 成人a级免费电影| 91在线观看视频| 欧美一级生活片| 国产欧美日韩中文久久| 伊人色综合久久天天| 国产九九视频一区二区三区| 精品视频123区在线观看| 欧美电影一区二区| 亚洲国产aⅴ天堂久久| 国产真实乱对白精彩久久| 91精品在线麻豆| 一级做a爱片久久| 成人免费视频app| 欧美成人vr18sexvr| 一区二区三区不卡视频| 久久99久久精品欧美| 在线精品视频一区二区| 日韩毛片在线免费观看| 国产在线视视频有精品| 欧美精品久久天天躁| 亚洲va欧美va天堂v国产综合| 97久久人人超碰| 亚洲三级小视频| 成人免费视频免费观看| 一区二区三区免费看视频| 成人午夜电影久久影院| 日韩理论电影院| 99riav久久精品riav| 国产夜色精品一区二区av| 成人高清视频在线| 亚洲婷婷在线视频| 国产福利91精品一区二区三区| 精品国产成人系列| 成人福利电影精品一区二区在线观看| 国产精品久久久久久久久图文区 | 日韩欧美激情在线| 国产一区二区三区四| 久久综合九色综合97婷婷女人| 懂色av噜噜一区二区三区av| 亚洲一区二区三区中文字幕| 91黄色小视频| 日本中文一区二区三区| 国产日产亚洲精品系列| 色先锋久久av资源部| 久久成人免费网站| 亚洲人妖av一区二区| 欧美久久久久久蜜桃| voyeur盗摄精品| 免费观看一级欧美片| 亚洲精品中文在线影院| 精品国产a毛片| 91久久香蕉国产日韩欧美9色| 国产精品一二三四| 免费久久精品视频| 偷拍自拍另类欧美| 亚洲一区二区精品久久av| 欧美精彩视频一区二区三区| 欧美乱妇15p| 成人av先锋影音| 国产福利一区二区三区视频| 亚洲色图丝袜美腿| 中文字幕欧美一区| 亚洲天堂av一区| 国产欧美日韩在线视频| 国产精品九色蝌蚪自拍| 国产精品久久久久久久久久久免费看 | 9色porny自拍视频一区二区| 国产成人精品亚洲日本在线桃色 | 日韩亚洲电影在线| 欧美视频你懂的| 色综合天天综合网天天狠天天| 国产东北露脸精品视频| 国产成人精品网址| 成人精品免费网站| 99re6这里只有精品视频在线观看| 成人网男人的天堂| 国产精品一区二区三区乱码|