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

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

?? os_time.c

?? 基于STR711的I2C程序
?? C
字號(hào):
/*
*********************************************************************************************************
*                                                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    

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级淫片007| 日韩亚洲欧美高清| 亚洲欧洲av一区二区三区久久| 国产成人综合视频| 亚洲欧美另类久久久精品| 色哟哟一区二区三区| 亚洲免费观看高清完整版在线 | 色哟哟国产精品| 一区二区三区欧美日韩| 欧美剧情片在线观看| 另类的小说在线视频另类成人小视频在线| 51午夜精品国产| 国产精一区二区三区| 亚洲伦在线观看| 欧美精品第1页| 精品一区二区三区在线观看国产| 欧美国产精品中文字幕| 色噜噜夜夜夜综合网| 日韩精品高清不卡| 国产精品免费人成网站| 欧美日韩一区二区三区在线看 | 激情综合色播五月| 国产精品亲子伦对白| 欧美三区免费完整视频在线观看| 久久黄色级2电影| ...av二区三区久久精品| 91精品啪在线观看国产60岁| 风间由美性色一区二区三区| 亚洲午夜激情网页| 国产午夜精品久久| 91精品国产综合久久小美女| 成人午夜在线播放| 免费人成在线不卡| 亚洲日本欧美天堂| 久久婷婷成人综合色| 精品视频1区2区| www.亚洲色图.com| 精品一区二区三区视频在线观看| 亚洲色图视频免费播放| 精品卡一卡二卡三卡四在线| 91丨九色丨蝌蚪丨老版| 韩国精品免费视频| 日韩精品色哟哟| 有码一区二区三区| 国产精品久久久久久久久免费相片| 欧美精品vⅰdeose4hd| 日韩精品专区在线| 91在线精品一区二区| 精品一区二区免费看| 亚洲国产精品影院| 亚洲男人电影天堂| 中文字幕五月欧美| 国产欧美日韩在线视频| 日韩美一区二区三区| 欧美美女一区二区三区| 色婷婷综合久色| 日韩一区二区电影网| 亚洲国产综合人成综合网站| 欧美日韩成人在线一区| 日本va欧美va精品发布| 日韩精品专区在线影院重磅| 国产精品一二一区| 一区二区三区中文字幕精品精品 | 亚洲日本va在线观看| 丁香六月综合激情| 中文字幕在线免费不卡| 欧美日韩亚洲另类| 久久66热re国产| 亚洲欧美日韩小说| 精品国产乱码久久久久久蜜臀| 91高清视频免费看| 国产婷婷色一区二区三区| 欧美日韩精品一区二区三区四区| 亚洲天堂久久久久久久| 91日韩在线专区| 亚洲一区二区三区国产| 国产网站一区二区三区| 日韩欧美国产一区二区三区| 中文字幕色av一区二区三区| 亚洲观看高清完整版在线观看| 欧美日韩精品是欧美日韩精品| 色欧美日韩亚洲| 在线影院国内精品| 欧美中文字幕一区二区三区| 欧美亚洲自拍偷拍| 欧美老女人在线| 日韩一区二区在线观看| 欧美成人aa大片| 日本一区二区三区久久久久久久久不| 国产亚洲精品中文字幕| 中文字幕第一区综合| 亚洲精品中文在线影院| 香蕉久久夜色精品国产使用方法| 日韩黄色一级片| 国产一区二区三区免费| 9l国产精品久久久久麻豆| 色噜噜久久综合| 欧美一级在线观看| 欧美韩国日本一区| 亚洲人成精品久久久久久| 午夜视频一区在线观看| 国产在线精品免费| 99久久国产综合精品色伊| 色婷婷av一区二区三区软件| 91精品国产色综合久久不卡电影| 26uuu亚洲| 一区二区三区四区高清精品免费观看 | 亚洲福利一二三区| 另类综合日韩欧美亚洲| 成人午夜大片免费观看| 国产视频不卡一区| 一区二区三区国产| 久久99精品久久久久| www.激情成人| 91精品久久久久久久久99蜜臂| 国产欧美一区二区三区沐欲 | 欧美韩日一区二区三区四区| 一区二区三区成人在线视频| 久久国产成人午夜av影院| 波多野洁衣一区| 日韩欧美国产一二三区| 亚洲精品高清在线| 国产精品456露脸| 欧美欧美午夜aⅴ在线观看| 欧美激情艳妇裸体舞| 秋霞成人午夜伦在线观看| 99视频国产精品| 精品国产自在久精品国产| 亚洲九九爱视频| 国产福利不卡视频| 欧美一区二区三区视频| 亚洲激情欧美激情| 国产成人免费在线观看| 日韩精品最新网址| 亚洲国产精品视频| 99精品黄色片免费大全| 久久久久97国产精华液好用吗| 午夜视黄欧洲亚洲| 色综合色综合色综合| 中文字幕免费在线观看视频一区| 日韩av网站免费在线| 在线免费观看日韩欧美| 国产精品国产三级国产aⅴ无密码| 久久精品99国产国产精| 91精品在线免费观看| 亚洲一区二区三区小说| 91在线你懂得| 国产精品久久三| 成人精品视频网站| 26uuu亚洲婷婷狠狠天堂| 亚洲精品ww久久久久久p站| 国产黄色成人av| 国产精品久久久久国产精品日日| 激情欧美日韩一区二区| 欧美精品一区二区精品网| 日本成人在线一区| 欧美精品一区二区不卡| 成人精品国产一区二区4080| 国产精品丝袜在线| 欧美亚洲日本国产| 美女高潮久久久| 亚洲精品一区二区三区四区高清| 美女精品自拍一二三四| 欧美mv和日韩mv国产网站| 国产精品资源在线看| 国产视频一区二区在线| 成人午夜电影久久影院| 亚洲激情五月婷婷| 久久色在线视频| 色综合一区二区三区| 乱一区二区av| 亚洲伊人色欲综合网| 一区二区欧美精品| 在线综合亚洲欧美在线视频| 亚洲午夜私人影院| 日韩一本二本av| 日韩精品一区二区三区三区免费 | 国产精品正在播放| 51精品国自产在线| 日本免费在线视频不卡一不卡二| 日韩一二三区视频| 国产精品99久久久| 中文字幕亚洲电影| 欧美综合久久久| 免费不卡在线观看| 国产视频不卡一区| 日本韩国欧美国产| 日av在线不卡| 国产三级精品在线| 在线观看国产精品网站| 奇米色777欧美一区二区| 国产日韩精品一区二区三区| 97久久超碰精品国产| 午夜精品影院在线观看| 欧美精品一区二区三区视频| 北条麻妃国产九九精品视频| 亚洲一二三四区| 久久人人爽爽爽人久久久| 91麻豆免费观看| 精品一区二区三区在线播放 |