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

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

?? os_tmr.c

?? 基于ucos的arm7 lpc2138的lcd程序
?? 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一区二区三区免费野_久草精品视频
国产欧美日韩综合| 日韩欧美卡一卡二| 伊人婷婷欧美激情| 色婷婷一区二区三区四区| 亚洲精品老司机| 欧美日韩国产欧美日美国产精品| 亚洲黄色免费电影| 欧美美女黄视频| 精品一二三四区| 国产午夜精品在线观看| av一区二区三区在线| 一区二区三区日韩在线观看| 日本一区二区不卡视频| 91在线看国产| 日日夜夜免费精品| 欧美激情中文字幕一区二区| 一本大道综合伊人精品热热| 天堂精品中文字幕在线| 精品国产伦一区二区三区免费| 国产成人亚洲综合色影视| 亚洲你懂的在线视频| 欧美一区二区视频在线观看2020 | 日韩一卡二卡三卡国产欧美| 精品一区二区久久| 中文字幕佐山爱一区二区免费| 欧美色综合网站| 国产一区二区三区在线观看免费| 亚洲欧美另类久久久精品| 4hu四虎永久在线影院成人| 国产麻豆视频一区二区| 亚洲综合一区二区精品导航| 欧美videossexotv100| 一本色道亚洲精品aⅴ| 韩国精品主播一区二区在线观看| 亚洲激情校园春色| 国产欧美一区在线| 欧美一级在线观看| 色综合天天综合色综合av | 26uuu久久综合| 91福利视频久久久久| 国内外成人在线视频| 亚洲国产欧美在线| 国产精品美女一区二区在线观看| 欧美丰满高潮xxxx喷水动漫| 91亚洲精品一区二区乱码| 韩国午夜理伦三级不卡影院| 视频一区二区不卡| 亚洲精品欧美专区| 国产精品视频麻豆| 久久奇米777| 日韩欧美视频在线| 欧美日韩午夜在线| 91小视频在线免费看| 成人免费视频免费观看| 美国十次了思思久久精品导航| 亚洲免费观看高清完整版在线观看 | 日韩亚洲欧美在线观看| 在线视频观看一区| 99久久综合色| 成人污污视频在线观看| 久久精品国产99| 日韩av二区在线播放| 亚洲永久精品大片| 亚洲精品视频在线看| 最新热久久免费视频| 国产精品久久久一区麻豆最新章节| 精品成人在线观看| 日韩视频123| 日韩一区中文字幕| 欧美高清一级片在线观看| 精品国产精品网麻豆系列| 日韩片之四级片| 欧美一二三在线| 日韩欧美一区电影| 日韩一区二区三区在线| 欧美一区二区三区的| 欧美一区二区三区男人的天堂| 51精品久久久久久久蜜臀| 日韩一区二区电影在线| 91精品久久久久久久久99蜜臂| 欧美女孩性生活视频| 欧美老肥妇做.爰bbww视频| 91麻豆精品国产综合久久久久久| 欧美日韩在线观看一区二区| 欧美日产在线观看| 日韩午夜在线影院| 久久这里只有精品视频网| 久久久国产精华| 国产精品乱人伦| 一区二区视频在线看| 亚洲国产精品久久久男人的天堂 | 日韩欧美一区二区视频| www国产亚洲精品久久麻豆| 久久久久久久一区| 中文字幕永久在线不卡| 亚洲精品视频一区二区| 午夜精品福利一区二区三区av| 男人的天堂亚洲一区| 东方aⅴ免费观看久久av| 91免费精品国自产拍在线不卡 | 国产精品资源网| 91蜜桃网址入口| 欧美精品一级二级| 久久精品综合网| 亚洲一区二区欧美激情| 日韩avvvv在线播放| 国产精品一区二区不卡| 99久久伊人精品| 欧美一区二区三区在线观看| 久久亚区不卡日本| 亚洲最大成人网4388xx| 精品一二线国产| 在线亚洲高清视频| 精品国产免费人成在线观看| 亚洲视频一二三| 激情综合色丁香一区二区| 成人av电影在线| 日韩欧美国产一二三区| 日韩一区有码在线| 久草在线在线精品观看| 色婷婷久久一区二区三区麻豆| 国产精品久久综合| 中文字幕av一区 二区| 精品一区二区三区免费观看| 精品国产免费一区二区三区四区| 国产精品美女一区二区在线观看| 亚洲一区影音先锋| 国产一区二区三区国产| 欧美日韩视频专区在线播放| 日本一区二区电影| 99re热这里只有精品视频| 日韩精品在线一区| 亚洲国产婷婷综合在线精品| 国产精品1区二区.| 91精品中文字幕一区二区三区| 日本一区二区成人在线| 久久草av在线| 欧美精品乱码久久久久久按摩 | 91原创在线视频| www精品美女久久久tv| 日日摸夜夜添夜夜添国产精品| 成人av集中营| 久久久国产综合精品女国产盗摄| 水蜜桃久久夜色精品一区的特点| 91在线高清观看| 国产精品美女久久久久aⅴ| 久久国产夜色精品鲁鲁99| 欧美日韩国产大片| 亚洲激情在线播放| jlzzjlzz亚洲女人18| 久久嫩草精品久久久久| 久久99最新地址| 欧美电影精品一区二区| 日韩1区2区日韩1区2区| 欧美日韩国产a| 无码av中文一区二区三区桃花岛| 色综合一区二区| 亚洲精品综合在线| 日本久久一区二区| 亚洲人一二三区| 色天使久久综合网天天| 亚洲欧洲日韩在线| caoporn国产精品| 中文字幕色av一区二区三区| 粉嫩av一区二区三区粉嫩| 国产日韩欧美精品综合| 国产一区啦啦啦在线观看| 久久综合一区二区| 精品在线观看视频| 26uuu另类欧美| 粉嫩在线一区二区三区视频| 国产视频一区二区三区在线观看| 美女视频网站久久| 精品99一区二区| 国产91露脸合集magnet| 欧美激情资源网| 色香色香欲天天天影视综合网| 亚洲欧美另类小说| 欧美日韩成人高清| 久久国产精品99精品国产| 亚洲精品一区二区三区影院| 国产在线精品一区二区不卡了 | 91麻豆视频网站| 亚洲一区视频在线| 91精品一区二区三区久久久久久 | 国产女人aaa级久久久级| 成人福利视频网站| 一二三区精品福利视频| 91.麻豆视频| 国产精品一级在线| 亚洲同性gay激情无套| 欧美群妇大交群的观看方式| 精品亚洲成av人在线观看| 中文字幕va一区二区三区| 色狠狠综合天天综合综合| 久久精品二区亚洲w码| 国产日韩欧美激情| 欧美亚洲国产怡红院影院| 麻豆精品视频在线观看| 亚洲欧洲性图库|