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

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

?? os_time.c

?? 基于GE00 實(shí)驗(yàn)系統(tǒng)開發(fā)板的實(shí)驗(yàn)指導(dǎo)用途
?? 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一区二区三区免费野_久草精品视频
日韩欧美一区二区不卡| 欧美一区二区在线免费播放| 亚洲高清免费在线| 久久影院午夜论| 91福利在线导航| 国产999精品久久久久久| 亚洲国产日韩av| 欧美韩国日本一区| 欧美精品一区二区三区久久久 | 欧美—级在线免费片| 欧美日韩国产另类一区| av资源站一区| 国产91精品露脸国语对白| 日韩av中文字幕一区二区 | 精品亚洲成av人在线观看| 亚洲专区一二三| 国产精品另类一区| 久久久久高清精品| 欧美xfplay| 日韩三级视频在线看| 欧美日韩中文精品| 欧美无乱码久久久免费午夜一区| 成人午夜在线播放| 国产一区二区久久| 国产一区二区女| 国产在线视频一区二区| 久久爱www久久做| 免费高清在线一区| 蜜桃视频一区二区| 毛片基地黄久久久久久天堂| 三级一区在线视频先锋| 亚洲国产一区视频| 午夜精品久久久久久久| 亚洲成人资源网| 天天操天天综合网| 视频一区视频二区在线观看| 亚洲成av人片在线观看| 亚洲一区二区三区视频在线播放| 综合久久一区二区三区| 亚洲日本va在线观看| 自拍偷拍欧美激情| 亚洲免费观看高清完整版在线观看 | 久久av资源站| 91蝌蚪porny成人天涯| 不卡一区二区在线| thepron国产精品| 99久久777色| 欧美在线观看一区二区| 欧美精品日韩综合在线| 欧美日韩性生活| 欧美一区二区三区思思人| 制服丝袜亚洲精品中文字幕| 欧美一级电影网站| 久久精品夜色噜噜亚洲a∨| 国产三级精品三级在线专区| 亚洲欧洲www| 伊人婷婷欧美激情| 日本不卡一区二区| 激情亚洲综合在线| 成人性生交大片免费看中文网站| 96av麻豆蜜桃一区二区| 欧美在线观看禁18| 精品人在线二区三区| 国产精品久久久久久久久果冻传媒| 国产精品久久777777| 伊人开心综合网| 蜜桃视频第一区免费观看| 国产寡妇亲子伦一区二区| 成人av动漫网站| 6080国产精品一区二区| 久久老女人爱爱| 亚洲精品国产精品乱码不99| 日韩激情中文字幕| 国产宾馆实践打屁股91| 日本二三区不卡| 精品嫩草影院久久| 亚洲色图视频网| 久久国产人妖系列| 成人99免费视频| 91精品国产欧美日韩| 日本一区二区视频在线观看| 亚洲午夜视频在线| 国产成人8x视频一区二区| 日本道在线观看一区二区| 2023国产一二三区日本精品2022| 亚洲欧洲三级电影| 男女男精品视频网| 99久久久久久| 26uuu精品一区二区| 一区二区三区日韩欧美精品| 人人狠狠综合久久亚洲| 99久久免费精品| 精品日本一线二线三线不卡| 一个色在线综合| 国产盗摄一区二区三区| 欧美精品免费视频| 亚洲欧洲制服丝袜| 国产精品一二三区在线| 欧美一区永久视频免费观看| 日韩码欧中文字| 国产麻豆一精品一av一免费| 欧美日韩国产一区二区三区地区| 欧美高清在线一区| 久久99国内精品| 精品视频123区在线观看| 国产精品污网站| 国产在线一区二区| 日韩精品一区二区三区中文精品| 免费看精品久久片| 91高清在线观看| 亚洲视频一区二区在线| 国产福利视频一区二区三区| 91精品国产综合久久香蕉麻豆| 亚洲欧洲综合另类| youjizz国产精品| 久久久久久久久久看片| 久久国产三级精品| 日韩精品资源二区在线| 午夜精品影院在线观看| 色狠狠综合天天综合综合| 亚洲国产精品成人综合| 国内精品国产三级国产a久久| 欧美久久久久免费| 天天影视色香欲综合网老头| 欧美午夜精品电影| 亚洲精品综合在线| 91丨porny丨国产入口| 中文字幕一区二区三区乱码在线| 国产精品一区二区三区乱码| 精品国产免费视频| 国产中文字幕一区| 精品国产免费人成电影在线观看四季| 亚洲成人资源在线| 在线综合+亚洲+欧美中文字幕| 亚洲成精国产精品女| 欧美日韩黄色影视| 天天射综合影视| 日韩欧美一区二区不卡| 久久疯狂做爰流白浆xx| 精品国产污污免费网站入口| 国产一区二区三区四区在线观看| 精品国产91乱码一区二区三区| 九九视频精品免费| 国产人久久人人人人爽| 成人国产精品免费观看| 亚洲婷婷综合久久一本伊一区| 色哟哟欧美精品| 亚洲一级电影视频| 欧美一区二区三区视频| 久久国产精品99久久人人澡| 久久久久久久综合色一本| 大桥未久av一区二区三区中文| 中文一区二区在线观看| youjizz久久| 亚洲电影中文字幕在线观看| 欧美一区二区三区小说| 国产一区二区三区视频在线播放| 久久综合丝袜日本网| 成人h动漫精品| 亚洲激情校园春色| 欧美一区二区免费观在线| 国产精品中文字幕日韩精品| 国产精品二三区| 欧美蜜桃一区二区三区| 久久精品国产网站| 国产精品乱人伦| 欧美人伦禁忌dvd放荡欲情| 国产一区二区三区在线观看精品 | 色综合天天视频在线观看| 亚洲午夜国产一区99re久久| 精品成a人在线观看| av在线这里只有精品| 丝袜美腿亚洲色图| 国产亚洲欧美色| 欧美系列一区二区| 国产在线麻豆精品观看| 亚洲精品国产精华液| 一区二区三区高清| 欧美成人在线直播| 色噜噜狠狠成人网p站| 久久狠狠亚洲综合| 中文字幕在线视频一区| 91精品国产综合久久婷婷香蕉 | 99久久精品一区二区| 人妖欧美一区二区| 亚洲欧美日韩国产综合| 日韩精品一区二区三区在线观看 | 日韩精品一区国产麻豆| 91丝袜美腿高跟国产极品老师 | 国产真实乱偷精品视频免| 一区二区在线观看视频在线观看| 日韩欧美一级在线播放| 一本色道久久综合亚洲91| 久久99精品国产麻豆不卡| 亚洲图片欧美一区| 国产精品天美传媒| 日韩欧美成人午夜| 在线观看亚洲a| 成人av资源站| 韩国女主播成人在线观看|