亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
91精品国产综合久久久久久| 欧美日韩一区视频| 91久久精品一区二区三| 91精品午夜视频| 一区二区三区在线免费播放| 国产成人无遮挡在线视频| 欧美日韩一区 二区 三区 久久精品| xnxx国产精品| 日本女人一区二区三区| 91片黄在线观看| 久久亚洲一区二区三区明星换脸| 亚洲电影第三页| 99re这里只有精品视频首页| 国产日韩精品视频一区| 国产在线精品免费| 欧美一区二区三区四区久久| 午夜影视日本亚洲欧洲精品| 色综合天天天天做夜夜夜夜做| 欧美精品一区二区高清在线观看 | 91亚洲男人天堂| 26uuu久久综合| 另类欧美日韩国产在线| 欧美日韩一区在线| 亚洲一区二区在线免费看| 91在线视频免费91| 国产精品久久久久婷婷二区次| 国产丶欧美丶日本不卡视频| www一区二区| 激情深爱一区二区| 26uuu另类欧美亚洲曰本| 久久精品国产久精国产| 精品999在线播放| 国产一区二区三区日韩 | 国产精品久久久久一区二区三区 | 在线观看一区二区视频| 亚洲自拍另类综合| 欧美在线视频全部完| 亚洲大尺度视频在线观看| 欧美日韩dvd在线观看| 亚洲韩国一区二区三区| 欧美精品久久一区二区三区| 人妖欧美一区二区| 久久免费午夜影院| 国产91精品一区二区| 一区二区中文视频| 欧洲精品中文字幕| 日韩激情av在线| 精品国产麻豆免费人成网站| 国产精品一二一区| 一区精品在线播放| 欧美日本国产一区| 乱中年女人伦av一区二区| 久久九九影视网| 99久久精品免费精品国产| 一区二区三区小说| 91精品黄色片免费大全| 国产剧情在线观看一区二区| **网站欧美大片在线观看| 色先锋久久av资源部| 日韩av午夜在线观看| 国产午夜精品一区二区| 欧美亚洲日本一区| 国产一区二区毛片| 一区二区在线观看免费视频播放| 欧美一区二区三区人| 东方欧美亚洲色图在线| 五月天精品一区二区三区| 精品国产91亚洲一区二区三区婷婷| 成人少妇影院yyyy| 日韩精品欧美精品| 成人欧美一区二区三区黑人麻豆| 欧美绝品在线观看成人午夜影视 | 久久99国产精品久久| 国产精品成人一区二区三区夜夜夜| 欧美亚洲高清一区二区三区不卡| 免费精品99久久国产综合精品| 欧美国产综合一区二区| 在线国产亚洲欧美| 国产v日产∨综合v精品视频| 性做久久久久久免费观看欧美| 国产亚洲福利社区一区| 欧美亚洲一区二区在线| 成人网男人的天堂| 激情图片小说一区| 天堂成人国产精品一区| 国产精品萝li| 久久久99免费| 日韩一本二本av| 欧美亚洲综合另类| 91小视频在线观看| 国产大陆亚洲精品国产| 青娱乐精品视频在线| 亚洲图片欧美色图| 亚洲男人天堂av| 国产精品传媒入口麻豆| 国产亚洲精品7777| 26uuu色噜噜精品一区二区| 欧美精品 日韩| 欧美日韩国产综合草草| 色天天综合色天天久久| 成人国产在线观看| 国产不卡在线播放| 粉嫩蜜臀av国产精品网站| 久久电影网站中文字幕| 美女性感视频久久| 琪琪久久久久日韩精品| 日本欧美加勒比视频| 五月婷婷综合在线| 天天影视网天天综合色在线播放| 亚洲精品网站在线观看| 亚洲欧美日韩久久| ...av二区三区久久精品| 中文字幕在线一区免费| 国产精品国产精品国产专区不片| 国产女人水真多18毛片18精品视频| 久久影院午夜论| 久久久久久久一区| 国产午夜精品美女毛片视频| 国产欧美日本一区视频| 日本一区二区三区电影| 国产精品高潮呻吟| 亚洲精品乱码久久久久久久久| 亚洲丝袜精品丝袜在线| 一区二区三区欧美视频| 亚洲福利视频导航| 日韩国产欧美在线播放| 麻豆国产精品视频| 国产乱国产乱300精品| 成人久久视频在线观看| 91麻豆蜜桃一区二区三区| 日本久久一区二区| 欧美精品久久久久久久久老牛影院| 91精品国产全国免费观看| 精品国产第一区二区三区观看体验 | 欧美岛国在线观看| 久久久久久久综合日本| 亚洲素人一区二区| 亚洲国产成人tv| 狠狠狠色丁香婷婷综合激情 | 最近中文字幕一区二区三区| 亚洲欧美日韩电影| 偷拍与自拍一区| 国产精品影音先锋| 在线欧美日韩精品| 精品国产一二三| 一区二区三区加勒比av| 麻豆精品久久久| 91色视频在线| 欧美一卡2卡3卡4卡| 国产精品网站在线| 首页综合国产亚洲丝袜| 国产成人三级在线观看| 精品国产一区二区三区忘忧草| 欧美国产一区视频在线观看| 亚洲一卡二卡三卡四卡五卡| 精品中文字幕一区二区| 91老师国产黑色丝袜在线| 日韩视频中午一区| 国产精品国产精品国产专区不蜜| 三级在线观看一区二区| 99久久精品国产精品久久 | 色婷婷av一区二区三区软件| 一区二区三区日韩欧美精品| 狠狠色狠狠色综合系列| 91久久精品一区二区三区| 日韩精品一区二区三区中文精品 | 久久久www免费人成精品| 亚洲一区二区精品3399| 国产91高潮流白浆在线麻豆| 91精品国产色综合久久不卡电影 | 色综合久久久久久久久| 国产亚洲美州欧州综合国| 图片区日韩欧美亚洲| 一本色道久久综合狠狠躁的推荐| 亚洲精品一区二区精华| 婷婷成人综合网| 91豆麻精品91久久久久久| 国产日产精品一区| 久久99久久久久| 欧美日韩国产在线观看| 一区二区三区毛片| 成人动漫视频在线| 国产欧美精品一区二区三区四区 | 亚洲国产va精品久久久不卡综合| 国产黑丝在线一区二区三区| 精品国产电影一区二区| 日韩在线a电影| 欧美久久免费观看| 亚洲人快播电影网| 97精品国产露脸对白| 国产亲近乱来精品视频| 国产一区二区三区免费看 | 国产精品香蕉一区二区三区| 日韩视频中午一区| 天天av天天翘天天综合网色鬼国产 | 一区二区三区四区乱视频| 成人黄色小视频在线观看| 国产欧美日韩精品a在线观看| 国产在线麻豆精品观看| www激情久久|