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

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

?? os_time.c

?? avr相關知識,該單元包括數據與地址移位寄存器TWDR
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                             TIME MANAGEMENT
*
*                          (c) Copyright 1992-2007, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_TIME.C
* By      : Jean J. Labrosse
* Version : V2.85
*
* 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   (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 = 0;
#endif



    if (OSIntNesting > 0) {                      /* See if trying to call from an ISR                  */
        return;
    }
    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_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 > 0
INT8U  OSTimeDlyHMSM (INT8U hours, INT8U minutes, INT8U seconds, INT16U ms)
{
    INT32U ticks;
    INT16U loops;


    if (OSIntNesting > 0) {                      /* See if trying to call from an ISR                  */
        return (OS_ERR_TIME_DLY_ISR);
    }
#if OS_ARG_CHK_EN > 0
    if (hours == 0) {
        if (minutes == 0) {
            if (seconds == 0) {
                if (ms == 0) {
                    return (OS_ERR_TIME_ZERO_DLY);
                }
            }
        }
    }
    if (minutes > 59) {
        return (OS_ERR_TIME_INVALID_MINUTES);    /* Validate arguments to be within range              */
    }
    if (seconds > 59) {
        return (OS_ERR_TIME_INVALID_SECONDS);
    }
    if (ms > 999) {
        return (OS_ERR_TIME_INVALID_MS);
    }
#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)ms + 500L / OS_TICKS_PER_SEC) / 1000L;
    loops = (INT16U)(ticks >> 16);               /* Compute the integral number of 65536 tick delays   */
    ticks = ticks & 0xFFFFL;                     /* Obtain  the fractional number of ticks             */
    OSTimeDly((INT16U)ticks);
    while (loops > 0) {
        OSTimeDly((INT16U)32768u);
        OSTimeDly((INT16U)32768u);
        loops--;
    }
    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.
*
*              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_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 > 0
INT8U  OSTimeDlyResume (INT8U prio)
{
    OS_TCB    *ptcb;
#if OS_CRITICAL_METHOD == 3                                    /* Storage for CPU status register      */
    OS_CPU_SR  cpu_sr = 0;
#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 == 0) {                                 /* See if task is delayed               */
        OS_EXIT_CRITICAL();
        return (OS_ERR_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->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 > 0
INT32U  OSTimeGet (void)
{
    INT32U     ticks;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#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 = 0;
#endif



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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
狠狠久久亚洲欧美| 美国毛片一区二区三区| 久久伊99综合婷婷久久伊| 91精品国产综合久久香蕉的特点 | 欧美一区二区三区免费观看视频 | 国产一区二区伦理| 久草在线在线精品观看| 久草在线在线精品观看| 精品一区二区三区在线视频| 久久国产精品无码网站| 久久精品99国产精品| 国产制服丝袜一区| 顶级嫩模精品视频在线看| 国产成人av一区二区三区在线| 国产在线观看一区二区| 成人综合在线观看| www.日韩精品| 欧美无人高清视频在线观看| 欧美人xxxx| 久久久.com| 亚洲精品免费一二三区| 五月天丁香久久| 国产在线视频一区二区三区| 从欧美一区二区三区| 在线一区二区三区四区五区| 欧美日韩免费一区二区三区视频| 欧美一区二区三区四区高清| 国产色婷婷亚洲99精品小说| 1024成人网色www| 日精品一区二区| 国产精品主播直播| 欧美在线观看视频一区二区| 欧美电影精品一区二区| 国产精品毛片无遮挡高清| 亚洲一区二区三区自拍| 久久国产精品72免费观看| 99re成人在线| 欧美成人精品二区三区99精品| 中文字幕欧美区| 日本不卡视频在线| 91麻豆精品在线观看| 日韩精品一区二区三区四区 | 欧美精品一区二区三区在线播放| **性色生活片久久毛片| 美女视频黄 久久| 日本久久精品电影| 久久久久国产精品麻豆ai换脸| 亚洲男人的天堂在线观看| 日韩电影免费一区| 99热这里都是精品| 久久久亚洲综合| 日韩国产在线观看一区| 91啪九色porn原创视频在线观看| 日韩欧美一级二级三级久久久| 国产精品国产三级国产有无不卡| 蜜桃视频一区二区三区| 在线视频欧美精品| 国产精品久久久久国产精品日日| 麻豆91在线播放免费| 欧美影院一区二区| 亚洲欧美日韩国产手机在线| 国产精品一卡二卡在线观看| 日韩一区二区三| 天天色综合天天| 欧美日韩一区二区不卡| 亚洲精品乱码久久久久久久久| 成人高清免费观看| 国产欧美日韩三级| 国产高清无密码一区二区三区| 精品国产乱码久久| 久久99精品久久久久| 日韩视频一区二区在线观看| 午夜精品国产更新| 欧美色欧美亚洲另类二区| 亚洲一区二区三区四区在线观看 | 午夜精品久久久久久久久久 | 裸体在线国模精品偷拍| 7777精品伊人久久久大香线蕉 | 成人免费一区二区三区视频| 成人性生交大片免费看视频在线| 国产亚洲欧美激情| 国产精品456露脸| 亚洲国产成人一区二区三区| 成人成人成人在线视频| 中文字幕在线播放不卡一区| 99久久综合国产精品| 亚洲美女屁股眼交| 欧美少妇xxx| 日本不卡一二三| 国产亚洲短视频| 色欲综合视频天天天| 一区二区国产视频| 欧美一区二区久久| 国产精品一区一区三区| 中文字幕亚洲欧美在线不卡| 欧美最猛性xxxxx直播| 午夜视频一区二区三区| 欧美成人猛片aaaaaaa| 国产成人精品免费一区二区| 国产精品久久久久久久久搜平片| 97久久超碰精品国产| 水蜜桃久久夜色精品一区的特点| 日韩视频在线永久播放| 国产精品白丝jk黑袜喷水| 亚洲欧洲日韩在线| 欧美日韩在线电影| 国产精品资源在线看| 亚洲精品中文字幕在线观看| 日韩精品一区二区三区四区| eeuss鲁片一区二区三区在线观看| 一区二区三区影院| 欧美精品一区二区三区视频| 91丨porny丨首页| 精品在线视频一区| 亚洲在线观看免费视频| 精品99999| 欧美日韩一区二区欧美激情| 91亚洲精品久久久蜜桃网站| 亚洲国产aⅴ天堂久久| 国产亚洲欧美日韩日本| 欧美天堂一区二区三区| 成人伦理片在线| 日韩精品一二三区| 亚洲欧美日韩国产一区二区三区| 欧美成人一区二区三区在线观看| 色综合咪咪久久| 国产乱色国产精品免费视频| 亚洲成人av在线电影| 中文字幕在线观看不卡| 久久综合色8888| 欧美日韩精品免费| 色妞www精品视频| 国产成人精品免费在线| 九九视频精品免费| 五月天亚洲婷婷| 伊人性伊人情综合网| 国产精品日韩成人| 精品久久久久久综合日本欧美| 欧美日韩综合一区| 一本久道中文字幕精品亚洲嫩| 高清国产一区二区| 国产一区激情在线| 久久er精品视频| 日韩电影在线观看网站| 亚洲成人手机在线| 亚洲高清免费观看高清完整版在线观看| 中文字幕 久热精品 视频在线| 日韩一级片网站| 7777女厕盗摄久久久| 欧美日韩精品一区二区三区四区 | 777久久久精品| 欧美日韩精品欧美日韩精品一| 97se亚洲国产综合自在线观| 丁香天五香天堂综合| 国内精品国产三级国产a久久| 美女网站在线免费欧美精品| 麻豆国产精品视频| 国内精品伊人久久久久av影院| 免费看黄色91| 国精品**一区二区三区在线蜜桃| 精品一区二区久久久| 国产一区欧美二区| 高清av一区二区| 91亚洲资源网| 欧美性色欧美a在线播放| 欧美视频在线一区| 欧美日韩国产三级| 欧美不卡激情三级在线观看| 精品第一国产综合精品aⅴ| xfplay精品久久| 中文文精品字幕一区二区| 亚洲色图视频网站| 日一区二区三区| 激情综合网天天干| 国产成人啪午夜精品网站男同| 成人午夜视频在线观看| 91啪亚洲精品| 欧美一卡二卡在线| 久久男人中文字幕资源站| 中文av字幕一区| 午夜激情综合网| 国产精品一区二区在线观看网站| 成人性色生活片| 911精品国产一区二区在线| 欧美成人一级视频| 国产精品久久久久久久裸模| 亚洲一线二线三线久久久| 日本成人超碰在线观看| 成人永久看片免费视频天堂| 色94色欧美sute亚洲线路一ni | 色综合久久88色综合天天免费| 在线免费观看成人短视频| 日韩亚洲欧美中文三级| 亚洲国产精品t66y| 午夜欧美电影在线观看| 国产91丝袜在线播放九色| 欧美嫩在线观看| 亚洲欧洲99久久| 国产真实乱子伦精品视频| 欧美色区777第一页|