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

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

?? os_time.c

?? ucos2/2.90-STM32
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                              (c) Copyright 1992-2009, Micrium, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_TIME.C
* By      : Jean J. Labrosse
* Version : V2.91
*
* LICENSING TERMS:
* ---------------
*   uC/OS-II is provided in source form for FREE evaluation, for educational use or for peaceful research.
* If you plan on using  uC/OS-II  in a commercial product you need to contact Micri祄 to properly license
* its use in your product. We provide ALL the source code for your convenience and to help you experience
* uC/OS-II.   The fact that the  source is provided does  NOT  mean that you can use it without  paying a
* licensing fee.
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#include <ucos_ii.h>
#endif

/*
*********************************************************************************************************
*                                       DELAY TASK 'n' TICKS
*
* 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 (INT32U ticks)
{
    INT8U      y;
#if OS_CRITICAL_METHOD == 3u                     /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0u;
#endif



    if (OSIntNesting > 0u) {                     /* See if trying to call from an ISR                  */
        return;
    }
    if (OSLockNesting > 0u) {                    /* See if called with scheduler locked                */
        return;
    }
    if (ticks > 0u) {                            /* 0 means no delay!                                  */
        OS_ENTER_CRITICAL();
        y            =  OSTCBCur->OSTCBY;        /* Delay current task                                 */
        OSRdyTbl[y] &= (OS_PRIO)~OSTCBCur->OSTCBBitX;
        if (OSRdyTbl[y] == 0u) {
            OSRdyGrp &= (OS_PRIO)~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)
*              ms        specifies the number of milliseconds (max. 999)
*
* Returns    : OS_ERR_NONE
*              OS_ERR_TIME_INVALID_MINUTES
*              OS_ERR_TIME_INVALID_SECONDS
*              OS_ERR_TIME_INVALID_MS
*              OS_ERR_TIME_ZERO_DLY
*              OS_ERR_TIME_DLY_ISR
*
* 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 > 0u
INT8U  OSTimeDlyHMSM (INT8U   hours,
                      INT8U   minutes,
                      INT8U   seconds,
                      INT16U  ms)
{
    INT32U ticks;


    if (OSIntNesting > 0u) {                     /* See if trying to call from an ISR                  */
        return (OS_ERR_TIME_DLY_ISR);
    }
    if (OSLockNesting > 0u) {                    /* See if called with scheduler locked                */
        return (OS_ERR_SCHED_LOCKED);
    }
#if OS_ARG_CHK_EN > 0u
    if (hours == 0u) {
        if (minutes == 0u) {
            if (seconds == 0u) {
                if (ms == 0u) {
                    return (OS_ERR_TIME_ZERO_DLY);
                }
            }
        }
    }
    if (minutes > 59u) {
        return (OS_ERR_TIME_INVALID_MINUTES);    /* Validate arguments to be within range              */
    }
    if (seconds > 59u) {
        return (OS_ERR_TIME_INVALID_SECONDS);
    }
    if (ms > 999u) {
        return (OS_ERR_TIME_INVALID_MS);
    }
#endif
                                                 /* Compute the total number of clock ticks required.. */
                                                 /* .. (rounded to the nearest tick)                   */
    ticks = ((INT32U)hours * 3600uL + (INT32U)minutes * 60uL + (INT32U)seconds) * OS_TICKS_PER_SEC
          + OS_TICKS_PER_SEC * ((INT32U)ms + 500uL / OS_TICKS_PER_SEC) / 1000uL;
    OSTimeDly(ticks);
    return (OS_ERR_NONE);
}
#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.
*
* Arguments  : prio                      specifies the priority of the task to resume
*
* Returns    : OS_ERR_NONE               Task has been resumed
*              OS_ERR_PRIO_INVALID       if the priority you specify is higher that the maximum allowed
*                                        (i.e. >= OS_LOWEST_PRIO)
*              OS_ERR_TIME_NOT_DLY       Task is not waiting for time to expire
*              OS_ERR_TASK_NOT_EXIST     The desired task has not been created or has been assigned to a Mutex.
*********************************************************************************************************
*/

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



    if (prio >= OS_LOWEST_PRIO) {
        return (OS_ERR_PRIO_INVALID);
    }
    OS_ENTER_CRITICAL();
    ptcb = OSTCBPrioTbl[prio];                                 /* Make sure that task exist            */
    if (ptcb == (OS_TCB *)0) {
        OS_EXIT_CRITICAL();
        return (OS_ERR_TASK_NOT_EXIST);                        /* The task does not exist              */
    }
    if (ptcb == OS_TCB_RESERVED) {
        OS_EXIT_CRITICAL();
        return (OS_ERR_TASK_NOT_EXIST);                        /* The task does not exist              */
    }
    if (ptcb->OSTCBDly == 0u) {                                /* See if task is delayed               */
        OS_EXIT_CRITICAL();
        return (OS_ERR_TIME_NOT_DLY);                          /* Indicate that task was not delayed   */
    }

    ptcb->OSTCBDly = 0u;                                       /* 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->OSTCBStatPend  =  OS_STAT_PEND_TO;               /* Indicate PEND timeout                */
    } else {
        ptcb->OSTCBStatPend  =  OS_STAT_PEND_OK;
    }
    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_ERR_NONE);
}
#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 > 0u
INT32U  OSTimeGet (void)
{
    INT32U     ticks;
#if OS_CRITICAL_METHOD == 3u                     /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0u;
#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 > 0u
void  OSTimeSet (INT32U ticks)
{
#if OS_CRITICAL_METHOD == 3u                     /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0u;
#endif



    OS_ENTER_CRITICAL();
    OSTime = ticks;
    OS_EXIT_CRITICAL();
}
#endif
	 	   	  		 			 	    		   		 		 	 	 			 	    		   	 			 	  	 		 				 		  			 		 					 	  	  		      		  	   		      		  	 		 	      		   		 		  	 		 	      		  		  		  

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久综合九色综合欧美98| 欧美亚洲国产一区在线观看网站| 国产精品美日韩| 欧美日韩国产综合视频在线观看| 国产成人午夜视频| 污片在线观看一区二区| 欧美高清一级片在线观看| 欧美电影影音先锋| 色婷婷一区二区三区四区| 国产九色sp调教91| 奇米精品一区二区三区在线观看一 | 国产一区二区三区在线观看免费| 亚洲精品成人精品456| 日本一二三不卡| 久久综合给合久久狠狠狠97色69| 色婷婷国产精品| 成人午夜又粗又硬又大| 韩国三级电影一区二区| 日本 国产 欧美色综合| 亚洲国产欧美日韩另类综合 | 26uuu精品一区二区在线观看| 91国在线观看| 99久久精品一区| 国产传媒一区在线| 国内精品视频一区二区三区八戒| 日本不卡视频一二三区| 亚洲1区2区3区4区| 亚洲电影在线播放| 亚洲第一会所有码转帖| 亚洲最色的网站| 亚洲免费视频中文字幕| 国产精品久久久久一区二区三区| 国产午夜精品在线观看| 久久久九九九九| 久久综合九色综合97婷婷女人 | 欧美一级高清大全免费观看| 欧美视频一区二区三区在线观看| youjizz国产精品| eeuss鲁片一区二区三区在线看| 国产成人在线色| 成人丝袜视频网| 成人黄色在线看| 99精品视频在线观看| av亚洲精华国产精华精| 91丨九色丨尤物| 99re66热这里只有精品3直播| 99久久国产综合精品麻豆| 99re成人精品视频| 在线亚洲免费视频| 欧美精品成人一区二区三区四区| 91超碰这里只有精品国产| 欧美一区二区三区视频免费播放| 欧美一区二区三区人| 日韩精品专区在线| 国产丝袜美腿一区二区三区| 国产精品久久久久久久久免费桃花 | 麻豆精品一区二区av白丝在线| 捆绑调教一区二区三区| 国产剧情一区二区三区| 99久久综合狠狠综合久久| 在线亚洲+欧美+日本专区| 宅男在线国产精品| 久久久美女艺术照精彩视频福利播放| 国产欧美日韩三级| 专区另类欧美日韩| 肉丝袜脚交视频一区二区| 国产一区美女在线| 色综合网色综合| 7777精品伊人久久久大香线蕉的| 欧美精品第1页| 久久久久国产成人精品亚洲午夜 | 精品国产不卡一区二区三区| 久久奇米777| 亚洲免费观看高清完整版在线观看熊 | 麻豆成人综合网| 成人av影视在线观看| 欧洲一区二区av| 精品国产乱码久久久久久牛牛 | 日韩二区在线观看| 国产91丝袜在线播放九色| 在线观看www91| 日韩欧美国产一区二区三区| 国产精品护士白丝一区av| 亚洲高清免费视频| 国产传媒欧美日韩成人| 欧美日韩在线观看一区二区| 久久久国际精品| 亚洲国产欧美日韩另类综合| 国产一二精品视频| 欧美日韩国产美女| 国产精品国产三级国产a| 香蕉久久夜色精品国产使用方法 | 欧美日韩不卡一区| 国产精品女主播av| 麻豆精品在线观看| 欧美性生交片4| 久久精品一区蜜桃臀影院| 午夜精品福利一区二区蜜股av| 国产一区二区三区在线看麻豆| 欧美在线观看你懂的| 亚洲国产激情av| 美腿丝袜亚洲色图| 欧美性淫爽ww久久久久无| 中文字幕av一区二区三区高| 日韩av成人高清| 欧美专区在线观看一区| 国产精品免费人成网站| 看片的网站亚洲| 精品视频一区三区九区| 一区二区中文视频| 国产不卡视频一区| 久久综合狠狠综合久久综合88| 午夜久久久久久电影| 色狠狠av一区二区三区| 中文字幕第一页久久| 精品一区二区在线播放| 欧美一区二区三区免费在线看| 一区二区三区在线视频观看| 成人激情免费网站| 国产欧美日韩精品在线| 国产麻豆欧美日韩一区| 欧美v亚洲v综合ⅴ国产v| 日本免费新一区视频| 777xxx欧美| 午夜激情一区二区| 欧美无乱码久久久免费午夜一区| 亚洲色图在线视频| 91色porny蝌蚪| 亚洲人成精品久久久久久| 99在线精品观看| 亚洲人亚洲人成电影网站色| av成人免费在线观看| 亚洲欧洲日韩av| 91美女片黄在线观看| 亚洲欧美国产三级| 91成人在线免费观看| 亚洲精品视频免费看| 在线精品国精品国产尤物884a| 亚洲男人的天堂在线观看| 91麻豆福利精品推荐| 亚洲精品成人悠悠色影视| 日本韩国精品在线| 亚洲午夜羞羞片| 欧美日韩国产美女| 麻豆精品视频在线| 久久女同性恋中文字幕| 国产成人a级片| 亚洲欧洲精品一区二区三区 | 2020国产精品久久精品美国| 美国一区二区三区在线播放| www国产精品av| 豆国产96在线|亚洲| 亚洲图片你懂的| 欧美在线免费视屏| 久色婷婷小香蕉久久| 久久久久久久综合狠狠综合| 成人午夜又粗又硬又大| 一区二区三区国产精品| 91精品国产综合久久久久久久久久| 日韩国产在线一| 久久蜜桃香蕉精品一区二区三区| 不卡一区二区在线| 亚洲成人自拍偷拍| 日韩欧美中文一区二区| 国产成人在线影院| 一区二区在线电影| 日韩你懂的在线观看| av日韩在线网站| 三级一区在线视频先锋| 国产三级精品三级| 91国模大尺度私拍在线视频| 蜜桃av噜噜一区| 国产精品久久久久一区二区三区 | 久久狠狠亚洲综合| 国产精品不卡一区| 欧美浪妇xxxx高跟鞋交| 国产老妇另类xxxxx| 亚洲制服丝袜av| 久久久精品影视| 欧美视频一区二区三区四区| 国产精品羞羞答答xxdd | 在线播放中文字幕一区| 精品一区二区三区日韩| 亚洲精品日韩一| 久久影院电视剧免费观看| 在线观看亚洲专区| 国产伦精一区二区三区| 亚洲h精品动漫在线观看| 国产日产精品一区| 在线不卡a资源高清| 成人av午夜电影| 久久超碰97人人做人人爱| 亚洲精品成人天堂一二三| 久久青草国产手机看片福利盒子| 欧美中文字幕一区二区三区| 国产成人精品综合在线观看| 日韩有码一区二区三区| 亚洲免费观看高清| 国产色婷婷亚洲99精品小说| 欧美一级在线视频|