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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? os_tmr.c

?? ucos移植到S3C2410上的代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*
************************************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                            TIMER MANAGEMENT
*
*                              (c) Copyright 1992-2007, Micrium, Weston, FL
*                                           All Rights Reserved
*
*
* File    : OS_TMR.C
* By      : Jean J. Labrosse
* Version : V2.86
*
* 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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美一区二区三区国产精品| 亚洲美女免费视频| 色一区在线观看| 亚洲色图一区二区| 久久女同性恋中文字幕| 欧美xxx久久| 精品国产一区二区亚洲人成毛片| 日韩欧美一二三| 久久婷婷国产综合国色天香| 国产农村妇女精品| 亚洲天堂成人网| 亚洲国产日产av| 美女一区二区久久| 国内外成人在线| 国产成人a级片| 色女孩综合影院| 欧美日韩成人综合在线一区二区| 欧美丰满少妇xxxxx高潮对白| 日韩欧美一区二区不卡| 久久久亚洲欧洲日产国码αv| 国产情人综合久久777777| 亚洲色图第一区| 青青草国产成人av片免费| 国产乱人伦精品一区二区在线观看| 国产精品一区二区男女羞羞无遮挡 | 国产精华液一区二区三区| 懂色一区二区三区免费观看| 91丝袜美腿高跟国产极品老师 | 91视频一区二区| 欧美日韩精品免费观看视频| 欧美成人综合网站| 亚洲丝袜制服诱惑| 免费高清在线视频一区·| 国产乱码字幕精品高清av| 欧美亚洲一区二区三区四区| 精品国产人成亚洲区| 亚洲欧洲精品一区二区精品久久久 | 国产精品网友自拍| 午夜久久福利影院| 国产999精品久久| 欧美日韩一区二区三区高清| 久久综合色婷婷| 国产精品美女久久久久久2018| 午夜精品久久久久| 国产传媒欧美日韩成人| 欧美欧美欧美欧美| 亚洲乱码国产乱码精品精小说| 日本视频在线一区| 色噜噜狠狠一区二区三区果冻| 久久亚洲综合色| 全部av―极品视觉盛宴亚洲| 色哟哟在线观看一区二区三区| 久久综合九色综合97婷婷女人| 一区二区三区四区不卡在线 | 国产欧美一区二区精品婷婷| 亚洲第一成人在线| 色综合av在线| 中文字幕一区av| 国产激情视频一区二区三区欧美 | 国产精品视频第一区| 日韩福利电影在线| 欧美午夜精品久久久久久孕妇| 国产精品国产精品国产专区不片| 九色综合国产一区二区三区| 欧美日韩你懂得| 一区二区三区在线高清| 色婷婷狠狠综合| 国产精品视频第一区| 高清成人在线观看| 国产女主播视频一区二区| 国内精品在线播放| 精品嫩草影院久久| 黄网站免费久久| 欧美精品一区二区三区在线| 韩国一区二区三区| 久久综合五月天婷婷伊人| 成人av第一页| 欧美激情一区二区三区四区| 国产a精品视频| 国产精品久久精品日日| aaa国产一区| 亚洲高清免费在线| 制服丝袜中文字幕一区| 蜜臀av性久久久久蜜臀aⅴ四虎| 日韩一级黄色大片| 国精产品一区一区三区mba桃花 | 亚洲一区成人在线| 欧美系列亚洲系列| 日本系列欧美系列| 国产亚洲一区二区三区四区 | 久久综合色天天久久综合图片| 老司机精品视频导航| 久久美女高清视频| 91伊人久久大香线蕉| 亚洲国产毛片aaaaa无费看| 欧美日韩精品一区二区三区蜜桃| 午夜精品aaa| 久久久久久久综合日本| 91免费在线播放| 日韩中文字幕不卡| 久久精品人人爽人人爽| 97久久久精品综合88久久| 亚洲蜜臀av乱码久久精品| 欧美一级免费大片| 国产激情一区二区三区桃花岛亚洲| 成人欧美一区二区三区黑人麻豆 | 亚洲一区二区三区爽爽爽爽爽| 欧美日韩免费高清一区色橹橹| 国产精一区二区三区| 亚洲欧美偷拍另类a∨色屁股| 欧美人牲a欧美精品| 国产91丝袜在线播放| 亚洲电影一区二区三区| 欧美精品一区二区三区蜜臀| 91国偷自产一区二区开放时间| 美女mm1313爽爽久久久蜜臀| 日韩毛片视频在线看| 日韩亚洲欧美在线| 一本久久a久久免费精品不卡| 激情综合色播激情啊| 亚洲国产日韩一区二区| 国产欧美中文在线| 日韩视频一区二区三区 | 午夜电影久久久| 国产欧美va欧美不卡在线| 69久久99精品久久久久婷婷| 91麻豆视频网站| 国产91精品一区二区麻豆亚洲| 亚洲国产另类av| 亚洲卡通欧美制服中文| 国产亚洲精久久久久久| 678五月天丁香亚洲综合网| 99视频一区二区| 高清国产一区二区| 国内精品久久久久影院薰衣草| 三级欧美在线一区| 亚洲自拍偷拍综合| 亚洲天堂免费看| 中文字幕亚洲综合久久菠萝蜜| 久久久久久99精品| 精品美女在线观看| 日韩视频国产视频| 欧美精品在线观看播放| 欧美伊人久久久久久久久影院| 99v久久综合狠狠综合久久| 国产精品一区二区在线看| 麻豆免费看一区二区三区| 丝袜脚交一区二区| 亚洲一区免费观看| 亚洲一区二区在线免费观看视频 | 免费成人结看片| 天涯成人国产亚洲精品一区av| 亚洲影视在线播放| 一区二区三区在线观看欧美| 夜夜嗨av一区二区三区网页| 亚洲黄网站在线观看| 樱花草国产18久久久久| 怡红院av一区二区三区| 亚洲成人资源网| 天堂成人免费av电影一区| 日韩黄色免费网站| 免费高清不卡av| 久久99国产精品麻豆| 国产一区二区视频在线播放| 国产一区二区三区免费播放| 国产精品一区二区三区四区| 不卡电影一区二区三区| 91啪亚洲精品| 欧美一区二区三区在| 欧美va亚洲va香蕉在线| 国产日韩欧美在线一区| 亚洲日本在线天堂| 偷拍日韩校园综合在线| 久草这里只有精品视频| 成人av资源在线| 欧美日韩夫妻久久| 国产午夜亚洲精品羞羞网站| 国产精品高潮久久久久无| 亚洲国产综合视频在线观看| 欧美aaa在线| 99久久国产综合精品色伊| 欧美精品第一页| 欧美国产一区二区| 午夜精品一区在线观看| 国产成人自拍网| 欧美三级乱人伦电影| www国产成人免费观看视频 深夜成人网| 久久精品亚洲国产奇米99| 亚洲综合色区另类av| 国产麻豆精品在线| 欧美日韩一卡二卡三卡 | 亚洲高清一区二区三区| 国产老女人精品毛片久久| 欧美色图激情小说| 中文字幕国产一区| 爽好久久久欧美精品| 成人a区在线观看| 欧美成人伊人久久综合网| 亚洲一区二区视频| 成人午夜看片网址|