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

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

?? os_time.c

?? ~{WwU_J9SC5D~}ucos~{T4Bk#,1`RkA4=S5wJT>y?IRT#,4x~}uart~{2bJT~}
?? 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    
    INT8U      y;


    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 (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);
    }
                                                 /* 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 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久久精品国产观看| 丁香桃色午夜亚洲一区二区三区| 久久精品国产亚洲a| 青草av.久久免费一区| 日韩高清在线观看| 久久国产精品一区二区| 日韩影院在线观看| 男女男精品网站| 美女网站色91| 国产一区二区三区久久久 | 亚洲一区电影777| 一区二区在线观看免费| 亚洲一区视频在线| 午夜精品久久久久久久蜜桃app| 亚洲成av人片www| 日韩成人精品在线观看| 久久成人精品无人区| 国产一区二区三区免费播放| 岛国av在线一区| 在线观看国产一区二区| 91麻豆精品国产91久久久久| 日韩免费观看2025年上映的电影| 久久色在线观看| 国产精品美女久久久久av爽李琼 | 国产精品沙发午睡系列990531| 国产精品久线在线观看| 亚洲综合丝袜美腿| 蜜臀av在线播放一区二区三区| 国产精品一二三区在线| 99视频国产精品| 欧美日韩综合一区| 欧美精品一区二区在线观看| 日本一区二区三区在线观看| 亚洲精品一卡二卡| 日本最新不卡在线| 国产电影一区在线| 欧美性高清videossexo| 欧美一二三区在线| 亚洲国产岛国毛片在线| 一区二区三区电影在线播| 日韩精品一二三四| 成人一区在线看| 欧美日韩高清一区二区三区| 欧美大片免费久久精品三p| 国产精品少妇自拍| 奇米精品一区二区三区在线观看 | 欧美日韩视频专区在线播放| 亚洲精品在线免费播放| 亚洲日本va在线观看| 全部av―极品视觉盛宴亚洲| 不卡的av电影| 欧美一区二区三区喷汁尤物| 国产精品美女久久久久aⅴ国产馆| 亚洲国产欧美在线| 成人免费观看视频| 91精品国产麻豆国产自产在线| 国产免费成人在线视频| 日本强好片久久久久久aaa| 成人性生交大合| 4438x成人网最大色成网站| 国产精品成人免费在线| 日本欧美一区二区三区乱码| 91丝袜国产在线播放| 精品国产伦理网| 视频一区视频二区在线观看| 成人手机电影网| 欧美成人在线直播| 亚洲成人一区在线| 99视频精品在线| 国产午夜精品一区二区三区四区 | 不卡视频一二三四| 欧美成人国产一区二区| 一区二区三区不卡视频 | 精品久久久影院| 亚洲国产毛片aaaaa无费看| www.亚洲精品| 国产亚洲一区字幕| 蜜臀a∨国产成人精品| 欧美在线一二三四区| 中文字幕中文乱码欧美一区二区| 精品一区二区三区免费| 欧美精三区欧美精三区| 亚洲一区电影777| 欧美中文字幕久久| 夜夜嗨av一区二区三区中文字幕| 成人亚洲一区二区一| 久久综合99re88久久爱| 久久99这里只有精品| 日韩一区二区免费视频| 偷拍与自拍一区| 欧美亚洲一区三区| 亚洲国产视频一区二区| 色综合久久精品| 玉米视频成人免费看| 色综合天天综合网天天看片| 国产精品美日韩| 成人黄色一级视频| 国产精品二区一区二区aⅴ污介绍| 国产成人在线色| 国产色产综合产在线视频| 国产精品99久久久久久有的能看| 精品对白一区国产伦| 精品一区二区在线看| 欧美精品一区二区精品网| 久久9热精品视频| 久久久久久久免费视频了| 韩日欧美一区二区三区| 久久久777精品电影网影网| 国产精品综合一区二区三区| 久久久另类综合| 成人app软件下载大全免费| 国产精品电影一区二区| 色视频成人在线观看免| 亚洲18色成人| 欧美电影免费观看高清完整版在 | 国产精品网站在线观看| 97久久精品人人做人人爽50路| 国产精品护士白丝一区av| 91麻豆国产香蕉久久精品| 亚洲一区二三区| 日韩午夜电影在线观看| 国产精品综合一区二区三区| 亚洲欧洲精品成人久久奇米网| 色婷婷综合久久久中文一区二区| 亚洲综合成人网| 日韩精品一区二区三区老鸭窝| 成人丝袜18视频在线观看| 一区二区三区欧美日韩| 9191国产精品| 国产一区二区中文字幕| 国产精品久久久爽爽爽麻豆色哟哟| 色综合久久中文综合久久牛| 亚洲福利视频导航| 精品国产sm最大网站免费看| 成人av免费在线| 天天综合天天做天天综合| 久久精品视频免费| 色婷婷激情综合| 老鸭窝一区二区久久精品| 国产欧美精品一区二区色综合朱莉| 色综合中文字幕| 激情综合色丁香一区二区| 中文字幕中文在线不卡住| 91精品国产麻豆| 99视频热这里只有精品免费| 欧美aⅴ一区二区三区视频| 日本一区二区三区四区在线视频| 欧美色大人视频| 国产成人亚洲综合色影视| 一区二区三区日本| 久久综合五月天婷婷伊人| 在线看国产日韩| 国产成人精品免费视频网站| 亚洲一区电影777| 国产午夜亚洲精品理论片色戒 | 国产精品福利一区二区三区| 欧美一区中文字幕| 99r国产精品| 国内精品伊人久久久久av一坑| 亚洲免费视频中文字幕| 久久先锋影音av| 欧美日韩日日摸| 波多野结衣欧美| 久久精品国产亚洲高清剧情介绍 | 欧美精品一区二| 欧美色图免费看| 波多野结衣欧美| 国产一区二区三区四区五区美女| 亚洲国产成人tv| 一区在线观看免费| 久久亚洲免费视频| 欧美一级久久久久久久大片| 色偷偷成人一区二区三区91| 国产福利一区二区三区| 蜜臀av一级做a爰片久久| 亚洲午夜久久久久久久久电影网| 亚洲国产精品t66y| 久久影视一区二区| 欧美一级黄色片| 欧美日韩不卡一区二区| 色狠狠一区二区三区香蕉| 粉嫩一区二区三区性色av| 精品一区二区三区免费播放| 日韩国产在线观看一区| 91麻豆123| 成人精品在线视频观看| 国产一区二区三区四| 人妖欧美一区二区| 日韩高清不卡在线| 天天色综合天天| 亚洲国产一区在线观看| 亚洲图片激情小说| 中日韩av电影| 国产精品免费人成网站| 国产婷婷色一区二区三区四区 | 欧美激情自拍偷拍| 久久青草国产手机看片福利盒子 | 精品久久久久久久久久久久包黑料|