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

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

?? os_tmr.c

?? avr相關知識,該單元包括數據與地址移位寄存器TWDR
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*
************************************************************************************************************************
*                                                      uC/OS-III
*                                                 The Real-Time Kernel
*
*                                     (c) Copyright 2005-2007, Micrium, Weston, FL
*                                                  All Rights Reserved
*
*                                                   TIMER MANAGEMENT
*
* File    : OS_TMR.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.
************************************************************************************************************************
*/

#include <ucos_ii.h>

/*
************************************************************************************************************************
*                                                        NOTES
*
* 1) Your application MUST define the following #define constants:
*
*    OS_TASK_TMR_PRIO          The priority of the Timer management task
*    OS_TASK_TMR_STK_SIZE      The size     of the Timer management task's stack
*
* 2) You must call OSTmrSignal() to notify the Timer management task that it's time to update the timers.
************************************************************************************************************************
*/

/*
************************************************************************************************************************
*                                                     CONSTANTS
************************************************************************************************************************
*/

#define  OS_TMR_LINK_DLY       0
#define  OS_TMR_LINK_PERIODIC  1

/*
************************************************************************************************************************
*                                                  LOCAL PROTOTYPES
************************************************************************************************************************
*/

#if OS_TMR_EN > 0
static  OS_TMR  *OSTmr_Alloc         (void);
static  void     OSTmr_Free          (OS_TMR *ptmr);
static  void     OSTmr_InitTask      (void);
static  void     OSTmr_Link          (OS_TMR *ptmr, INT8U type);
static  void     OSTmr_Unlink        (OS_TMR *ptmr);
static  void     OSTmr_Lock          (void);
static  void     OSTmr_Unlock        (void);
static  void     OSTmr_Task          (void   *p_arg);
#endif

/*$PAGE*/
/*
************************************************************************************************************************
*                                                   CREATE A TIMER
*
* Description: This function is called by your application code to create a timer.
*
* Arguments  : dly           Initial delay.
*                            If the timer is configured for ONE-SHOT mode, this is the timeout used
*                            If the timer is configured for PERIODIC mode, this is the first timeout to wait for
*                               before the timer starts entering periodic mode
*
*              period        The 'period' being repeated for the timer.
*                               If you specified 'OS_TMR_OPT_PERIODIC' as an option, when the timer expires, it will
*                               automatically restart with the same period.
*
*              opt           Specifies either:
*                               OS_TMR_OPT_ONE_SHOT       The timer counts down only once
*                               OS_TMR_OPT_PERIODIC       The timer counts down and then reloads itself
*
*              callback      Is a pointer to a callback function that will be called when the timer expires.  The
*                               callback function must be declared as follows:
*
*                               void MyCallback (OS_TMR *ptmr, void *p_arg);
*
*              callback_arg  Is an argument (a pointer) that is passed to the callback function when it is called.
*
*              pname         Is a pointer to an ASCII string that is used to name the timer.  Names are useful for
*                               debugging.  The length of the ASCII string for the name can be as big as:
*
*                               OS_TMR_CFG_NAME_SIZE and should be found in OS_CFG.H
*
*              perr          Is a pointer to an error code.  '*perr' will contain one of the following:
*                               OS_ERR_NONE
*                               OS_ERR_TMR_INVALID_DLY     you specified an invalid delay
*                               OS_ERR_TMR_INVALID_PERIOD  you specified an invalid period
*                               OS_ERR_TMR_INVALID_OPT     you specified an invalid option
*                               OS_ERR_TMR_ISR             if the call was made from an ISR
*                               OS_ERR_TMR_NON_AVAIL       if there are no free timers from the timer pool
*                               OS_ERR_TMR_NAME_TOO_LONG   if the timer name is too long to fit
*
* Returns    : A pointer to an OS_TMR data structure.  
*              This is the 'handle' that your application will use to reference the timer created.
************************************************************************************************************************
*/

#if OS_TMR_EN > 0
OS_TMR  *OSTmrCreate (INT32U           dly,
                      INT32U           period,
                      INT8U            opt,
                      OS_TMR_CALLBACK  callback,
                      void            *callback_arg,
                      INT8U           *pname,
                      INT8U           *perr)
{
    OS_TMR   *ptmr;
#if OS_TMR_CFG_NAME_SIZE > 0
    INT8U     len;
#endif


#if OS_ARG_CHK_EN > 0
    if (perr == (INT8U *)0) {                               /* Validate arguments                                     */
        return ((OS_TMR *)0);
    }
    switch (opt) {
        case OS_TMR_OPT_PERIODIC:
             if (period == 0) {
                 *perr = OS_ERR_TMR_INVALID_PERIOD;
                 return ((OS_TMR *)0);
             }
             break;

        case OS_TMR_OPT_ONE_SHOT:
             if (dly == 0) {
                 *perr = OS_ERR_TMR_INVALID_DLY;
                 return ((OS_TMR *)0);
             }
             break;

        default:
             *perr = OS_ERR_TMR_INVALID_OPT;
             return ((OS_TMR *)0);
    }
#endif
    if (OSIntNesting > 0) {                                 /* See if trying to call from an ISR                      */
        *perr  = OS_ERR_TMR_ISR;
        return ((OS_TMR *)0);
    }
    OSTmr_Lock();
    ptmr = OSTmr_Alloc();                                   /* Obtain a timer from the free pool                      */
    if (ptmr == (OS_TMR *)0) {
        OSTmr_Unlock();
        *perr = OS_ERR_TMR_NON_AVAIL;
        return ((OS_TMR *)0);
    }
    ptmr->OSTmrState       = OS_TMR_STATE_STOPPED;          /* Indicate that timer is not running yet                 */
    ptmr->OSTmrDly         = dly;
    ptmr->OSTmrPeriod      = period;
    ptmr->OSTmrOpt         = opt;
    ptmr->OSTmrCallback    = callback;
    ptmr->OSTmrCallbackArg = callback_arg;
#if OS_TMR_CFG_NAME_SIZE > 0
    if (pname !=(INT8U *)0) {
        len = OS_StrLen(pname);                             /* Copy timer name                                        */
        if (len < OS_TMR_CFG_NAME_SIZE) {
            (void)OS_StrCopy(ptmr->OSTmrName, pname);
        } else {
#if OS_TMR_CFG_NAME_SIZE > 1
            ptmr->OSTmrName[0] = '#';                       /* Invalid size specified                                 */
            ptmr->OSTmrName[1] = OS_ASCII_NUL;
#endif
            *perr              = OS_ERR_TMR_NAME_TOO_LONG;
            OSTmr_Unlock();
            return (ptmr);
        }
    }
#endif
    OSTmr_Unlock();
    *perr = OS_ERR_NONE;
    return (ptmr);
}
#endif

/*$PAGE*/
/*
************************************************************************************************************************
*                                                   DELETE A TIMER
*
* Description: This function is called by your application code to delete a timer.
*
* Arguments  : ptmr          Is a pointer to the timer to stop and delete.
*
*              perr          Is a pointer to an error code.  '*perr' will contain one of the following:
*                               OS_ERR_NONE
*                               OS_ERR_TMR_INVALID        'ptmr'  is a NULL pointer
*                               OS_ERR_TMR_INVALID_TYPE   'ptmr'  is not pointing to an OS_TMR
*                               OS_ERR_TMR_ISR            if the function was called from an ISR
*                               OS_ERR_TMR_INACTIVE       if the timer was not created
*                               OS_ERR_TMR_INVALID_STATE  the timer is in an invalid state
*
* Returns    : OS_TRUE       If the call was successful
*              OS_FALSE      If not
************************************************************************************************************************
*/

#if OS_TMR_EN > 0
BOOLEAN  OSTmrDel (OS_TMR  *ptmr,
                   INT8U   *perr)
{
#if OS_ARG_CHK_EN > 0
    if (perr == (INT8U *)0) {                               /* Validate arguments                                     */
        return (OS_FALSE);
    }
    if (ptmr == (OS_TMR *)0) {
        *perr = OS_ERR_TMR_INVALID;
        return (OS_FALSE);
    }
#endif
    if (ptmr->OSTmrType != OS_TMR_TYPE) {                   /* Validate timer structure                               */
        *perr = OS_ERR_TMR_INVALID_TYPE;
        return (OS_FALSE);
    }
    if (OSIntNesting > 0) {                                 /* See if trying to call from an ISR                      */
        *perr  = OS_ERR_TMR_ISR;
        return (OS_FALSE);
    }
    OSTmr_Lock();
    switch (ptmr->OSTmrState) {
        case OS_TMR_STATE_RUNNING:
             OSTmr_Unlink(ptmr);                            /* Remove from current wheel spoke                        */
             OSTmr_Free(ptmr);                              /* Return timer to free list of timers                    */
             OSTmr_Unlock();
             *perr = OS_ERR_NONE;
             return (OS_TRUE);

        case OS_TMR_STATE_STOPPED:                          /* Timer has not started or ...                           */
        case OS_TMR_STATE_COMPLETED:                        /* ... timer has completed the ONE-SHOT time              */
             OSTmr_Free(ptmr);                              /* Return timer to free list of timers                    */
             OSTmr_Unlock();
             *perr = OS_ERR_NONE;
             return (OS_TRUE);

        case OS_TMR_STATE_UNUSED:                           /* Already deleted                                        */
             OSTmr_Unlock();
             *perr = OS_ERR_TMR_INACTIVE;
             return (OS_FALSE);

        default:
             OSTmr_Unlock();
             *perr = OS_ERR_TMR_INVALID_STATE;
             return (OS_FALSE);
    }
}
#endif

/*$PAGE*/
/*
************************************************************************************************************************
*                                             GET THE NAME OF A TIMER
*
* Description: This function is called to obtain the name of a timer.
*
* Arguments  : ptmr          Is a pointer to the timer to obtain the name for
*
*              pdest         Is a pointer to where the name of the timer will be placed.  It is the caller's responsibility
*                            to ensure that he has sufficient storage in the destination, i.e. at least OS_TMR_CFG_NAME_SIZE
*
*              perr          Is a pointer to an error code.  '*perr' will contain one of the following:
*                               OS_ERR_NONE               The call was successful
*                               OS_ERR_TMR_INVALID_DEST   'pdest' is a NULL pointer
*                               OS_ERR_TMR_INVALID        'ptmr'  is a NULL pointer
*                               OS_ERR_TMR_INVALID_TYPE   'ptmr'  is not pointing to an OS_TMR
*                               OS_ERR_NAME_GET_ISR       if the call was made from an ISR
*                               OS_ERR_TMR_INACTIVE       'ptmr'  points to a timer that is not active

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区二区视频| 亚洲精品国产第一综合99久久| 午夜在线电影亚洲一区| 91久久精品网| 粉嫩高潮美女一区二区三区| 国产精品人人做人人爽人人添| 成+人+亚洲+综合天堂| 亚洲激情中文1区| 欧美日韩大陆一区二区| 久久精品国产一区二区| 国产丝袜欧美中文另类| 91亚洲国产成人精品一区二区三 | 亚洲国产毛片aaaaa无费看| 欧美熟乱第一页| 日本系列欧美系列| 久久久亚洲高清| 色视频欧美一区二区三区| 亚洲国产裸拍裸体视频在线观看乱了| 欧美一区二区成人| 国产suv精品一区二区6| 亚洲制服丝袜一区| 久久综合色综合88| 色综合网色综合| 老司机精品视频线观看86| 精品国产凹凸成av人网站| 成人的网站免费观看| 性做久久久久久久久| 久久久久久久久97黄色工厂| 99久久精品一区| 免费观看91视频大全| 欧美国产视频在线| 欧美日韩精品福利| 成人午夜视频在线| 日韩av一级电影| 综合久久国产九一剧情麻豆| 91.麻豆视频| 99国产精品久久久久久久久久 | 欧美日韩亚洲综合| 国产美女主播视频一区| 亚洲午夜三级在线| 国产精品天美传媒沈樵| 欧美丰满少妇xxxxx高潮对白| 福利一区二区在线| 麻豆视频一区二区| 一区二区三区久久| 亚洲国产精品ⅴa在线观看| 欧美一区二区三区在线电影| 91网站在线播放| 成人综合在线网站| 九九国产精品视频| 亚洲成av人片一区二区三区| 综合激情成人伊人| 久久久久国产精品麻豆ai换脸| 亚洲免费观看在线视频| 欧美成人精品高清在线播放| 色婷婷av一区二区三区大白胸 | 一区二区理论电影在线观看| 欧美国产一区视频在线观看| 日韩精品一区二区三区蜜臀| 欧美三级日本三级少妇99| 波多野结衣中文字幕一区二区三区 | 青青青伊人色综合久久| 亚洲欧美另类小说视频| 国产精品私房写真福利视频| 精品国产免费一区二区三区香蕉| 欧美精品高清视频| 欧美日韩国产乱码电影| 欧美在线免费观看亚洲| 色婷婷狠狠综合| 91国模大尺度私拍在线视频| caoporm超碰国产精品| 成人av在线资源网| 成人小视频在线| av一区二区久久| 成人一区在线观看| av一区二区不卡| 99精品国产热久久91蜜凸| 99久久亚洲一区二区三区青草 | 美女视频黄a大片欧美| 午夜日韩在线电影| 日韩av不卡一区二区| 日韩精品福利网| 日韩福利电影在线| 久久99精品久久久| 国产一区二区在线视频| 高清av一区二区| av福利精品导航| 欧美在线视频日韩| 7777精品伊人久久久大香线蕉 | 色哟哟欧美精品| 91福利精品视频| 欧美精品久久久久久久久老牛影院 | 在线区一区二视频| 欧美精品vⅰdeose4hd| 88在线观看91蜜桃国自产| 91麻豆精品91久久久久同性| 日韩女同互慰一区二区| 久久久久国色av免费看影院| 欧美激情艳妇裸体舞| 亚洲嫩草精品久久| 性做久久久久久久免费看| 韩日精品视频一区| 99精品视频在线播放观看| 欧美日韩国产一区二区三区地区| 日韩欧美中文字幕一区| 欧美国产一区二区| 亚洲国产精品欧美一二99| 精品一区二区三区在线播放视频| 风间由美一区二区av101| 欧美最猛黑人xxxxx猛交| 日韩欧美一二区| 亚洲欧洲日产国码二区| 日韩极品在线观看| 成人黄色国产精品网站大全在线免费观看 | 99精品在线观看视频| 欧美老年两性高潮| 国产亚洲精品中文字幕| 亚洲一区在线观看网站| 韩日av一区二区| 91国产成人在线| www激情久久| 亚洲成人在线观看视频| 国产精品一区二区久久精品爱涩| 色av一区二区| 久久久久久免费网| 日韩在线一二三区| av一区二区三区| 久久美女高清视频| 亚洲成人你懂的| 99国产欧美另类久久久精品| 日韩免费电影网站| 亚洲第一av色| 99久久精品免费| 亚洲精品一线二线三线无人区| 亚洲一区日韩精品中文字幕| 丁香天五香天堂综合| 日韩欧美另类在线| 午夜精品成人在线| 色哟哟亚洲精品| 日本一区二区三区国色天香| 日本欧美在线观看| 欧洲国内综合视频| 国产精品免费视频观看| 精品一区二区三区av| 91精品久久久久久蜜臀| 亚洲一区视频在线| 色综合久久中文综合久久牛| 久久久久国产成人精品亚洲午夜 | 久久99精品网久久| 欧美一区二区在线播放| 亚洲电影欧美电影有声小说| 99视频在线精品| 中文字幕在线不卡视频| 国产精品亚洲专一区二区三区 | 国产成人免费av在线| 欧美一区二区免费| 日韩黄色免费网站| 欧美亚日韩国产aⅴ精品中极品| 国产精品久久久久久久裸模| 国产精品一区不卡| 国产午夜精品一区二区三区视频| 久久精品国产成人一区二区三区| 911国产精品| 男女视频一区二区| 日韩一区二区三免费高清| 婷婷六月综合网| 欧美一级欧美三级| 美国毛片一区二区三区| 欧美一区二区三区在| 麻豆国产精品一区二区三区| 日韩一区二区三区电影| 九九国产精品视频| 久久久久久日产精品| 成人av电影在线网| 亚洲免费观看高清| 欧美日韩一区二区在线视频| 亚洲www啪成人一区二区麻豆| 欧美日韩你懂的| 麻豆91精品视频| 国产欧美一区二区三区网站| 成人免费的视频| 亚洲精品乱码久久久久久| 欧美性色欧美a在线播放| 肉肉av福利一精品导航| 欧美大白屁股肥臀xxxxxx| 国产在线看一区| 日本一区二区三区dvd视频在线| 成人精品一区二区三区四区 | 麻豆91精品91久久久的内涵| 久久久综合九色合综国产精品| 国产成人精品免费视频网站| 亚洲欧洲www| 欧美日韩精品是欧美日韩精品| 开心九九激情九九欧美日韩精美视频电影 | 久久99国产精品尤物| 国产女主播一区| 欧美色图免费看| 精品无人区卡一卡二卡三乱码免费卡 | 国产精品美日韩| 在线观看日韩毛片|