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

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

?? ucos ii v2.9 ?

?? uCOSII_V2.9
?? 9 ?
?? 第 1 頁 / 共 3 頁
字號:
{
    INT32U  remain;


#ifdef OS_SAFETY_CRITICAL
    if (perr == (INT8U *)0) {
        OS_SAFETY_CRITICAL_EXCEPTION();
    }
#endif

#if OS_ARG_CHK_EN > 0u
    if (ptmr == (OS_TMR *)0) {
        *perr = OS_ERR_TMR_INVALID;
        return (0u);
    }
#endif
    if (ptmr->OSTmrType != OS_TMR_TYPE) {              /* Validate timer structure                                    */
        *perr = OS_ERR_TMR_INVALID_TYPE;
        return (0u);
    }
    if (OSIntNesting > 0u) {                           /* See if trying to call from an ISR                           */
        *perr = OS_ERR_TMR_ISR;
        return (0u);
    }
    OSSchedLock();
    switch (ptmr->OSTmrState) {
        case OS_TMR_STATE_RUNNING:
             remain = ptmr->OSTmrMatch - OSTmrTime;    /* Determine how much time is left to timeout                  */
             OSSchedUnlock();
             *perr  = OS_ERR_NONE;
             return (remain);

        case OS_TMR_STATE_STOPPED:                     /* It's assumed that the timer has not started yet             */
             switch (ptmr->OSTmrOpt) {
                 case OS_TMR_OPT_PERIODIC:
                      if (ptmr->OSTmrDly == 0u) {
                          remain = ptmr->OSTmrPeriod;
                      } else {
                          remain = ptmr->OSTmrDly;
                      }
                      OSSchedUnlock();
                      *perr  = OS_ERR_NONE;
                      break;

                 case OS_TMR_OPT_ONE_SHOT:
                 default:
                      remain = ptmr->OSTmrDly;
                      OSSchedUnlock();
                      *perr  = OS_ERR_NONE;
                      break;
             }
             return (remain);

        case OS_TMR_STATE_COMPLETED:                   /* Only ONE-SHOT that timed out can be in this state           */
             OSSchedUnlock();
             *perr = OS_ERR_NONE;
             return (0u);

        case OS_TMR_STATE_UNUSED:
             OSSchedUnlock();
             *perr = OS_ERR_TMR_INACTIVE;
             return (0u);

        default:
             OSSchedUnlock();
             *perr = OS_ERR_TMR_INVALID_STATE;
             return (0u);
    }
}
#endif

/*$PAGE*/
/*
************************************************************************************************************************
*                                    FIND OUT WHAT STATE A TIMER IS IN
*
* Description: This function is called to determine what state the timer is in:
*
*                  OS_TMR_STATE_UNUSED     the timer has not been created
*                  OS_TMR_STATE_STOPPED    the timer has been created but has not been started or has been stopped
*                  OS_TMR_COMPLETED        the timer is in ONE-SHOT mode and has completed it's timeout
*                  OS_TMR_RUNNING          the timer is currently running
*
* Arguments  : ptmr          Is a pointer to the desired timer
*
*              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 call was made from an ISR
*                               OS_ERR_TMR_INACTIVE       'ptmr' points to a timer that is not active
*                               OS_ERR_TMR_INVALID_STATE  if the timer is not in a valid state
*
* Returns    : The current state of the timer (see description).
************************************************************************************************************************
*/

#if OS_TMR_EN > 0u
INT8U  OSTmrStateGet (OS_TMR  *ptmr,
                      INT8U   *perr)
{
    INT8U  state;


#ifdef OS_SAFETY_CRITICAL
    if (perr == (INT8U *)0) {
        OS_SAFETY_CRITICAL_EXCEPTION();
    }
#endif

#if OS_ARG_CHK_EN > 0u
    if (ptmr == (OS_TMR *)0) {
        *perr = OS_ERR_TMR_INVALID;
        return (0u);
    }
#endif
    if (ptmr->OSTmrType != OS_TMR_TYPE) {              /* Validate timer structure                                    */
        *perr = OS_ERR_TMR_INVALID_TYPE;
        return (0u);
    }
    if (OSIntNesting > 0u) {                           /* See if trying to call from an ISR                           */
        *perr = OS_ERR_TMR_ISR;
        return (0u);
    }
    OSSchedLock();
    state = ptmr->OSTmrState;
    switch (state) {
        case OS_TMR_STATE_UNUSED:
        case OS_TMR_STATE_STOPPED:
        case OS_TMR_STATE_COMPLETED:
        case OS_TMR_STATE_RUNNING:
             *perr = OS_ERR_NONE;
             break;

        default:
             *perr = OS_ERR_TMR_INVALID_STATE;
             break;
    }
    OSSchedUnlock();
    return (state);
}
#endif

/*$PAGE*/
/*
************************************************************************************************************************
*                                                   START A TIMER
*
* Description: This function is called by your application code to start a timer.
*
* Arguments  : ptmr          Is a pointer to an OS_TMR
*
*              perr          Is a pointer to an error code.  '*perr' will contain one of the following:
*                               OS_ERR_NONE
*                               OS_ERR_TMR_INVALID
*                               OS_ERR_TMR_INVALID_TYPE    'ptmr'  is not pointing to an OS_TMR
*                               OS_ERR_TMR_ISR             if the call was made 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 timer was started
*              OS_FALSE   if an error was detected
************************************************************************************************************************
*/

#if OS_TMR_EN > 0u
BOOLEAN  OSTmrStart (OS_TMR   *ptmr,
                     INT8U    *perr)
{
#ifdef OS_SAFETY_CRITICAL
    if (perr == (INT8U *)0) {
        OS_SAFETY_CRITICAL_EXCEPTION();
    }
#endif

#if OS_ARG_CHK_EN > 0u
    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 > 0u) {                                /* See if trying to call from an ISR                      */
        *perr  = OS_ERR_TMR_ISR;
        return (OS_FALSE);
    }
    OSSchedLock();
    switch (ptmr->OSTmrState) {
        case OS_TMR_STATE_RUNNING:                          /* Restart the timer                                      */
             OSTmr_Unlink(ptmr);                            /* ... Stop the timer                                     */
             OSTmr_Link(ptmr, OS_TMR_LINK_DLY);             /* ... Link timer to timer wheel                          */
             OSSchedUnlock();
             *perr = OS_ERR_NONE;
             return (OS_TRUE);

        case OS_TMR_STATE_STOPPED:                          /* Start the timer                                        */
        case OS_TMR_STATE_COMPLETED:
             OSTmr_Link(ptmr, OS_TMR_LINK_DLY);             /* ... Link timer to timer wheel                          */
             OSSchedUnlock();
             *perr = OS_ERR_NONE;
             return (OS_TRUE);

        case OS_TMR_STATE_UNUSED:                           /* Timer not created                                      */
             OSSchedUnlock();
             *perr = OS_ERR_TMR_INACTIVE;
             return (OS_FALSE);

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

/*$PAGE*/
/*
************************************************************************************************************************
*                                                   STOP A TIMER
*
* Description: This function is called by your application code to stop a timer.
*
* Arguments  : ptmr          Is a pointer to the timer to stop.
*
*              opt           Allows you to specify an option to this functions which can be:
*
*                               OS_TMR_OPT_NONE          Do nothing special but stop the timer
*                               OS_TMR_OPT_CALLBACK      Execute the callback function, pass it the callback argument
*                                                        specified when the timer was created.
*                               OS_TMR_OPT_CALLBACK_ARG  Execute the callback function, pass it the callback argument
*                                                        specified in THIS function call
*
*              callback_arg  Is a pointer to a 'new' callback argument that can be passed to the callback function
*                               instead of the timer's callback argument.  In other words, use 'callback_arg' passed in
*                               THIS function INSTEAD of ptmr->OSTmrCallbackArg
*
*              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_OPT     if you specified an invalid option for 'opt'
*                               OS_ERR_TMR_STOPPED         if the timer was already stopped
*                               OS_ERR_TMR_INVALID_STATE   the timer is in an invalid state
*                               OS_ERR_TMR_NO_CALLBACK     if the timer does not have a callback function defined
*
* Returns    : OS_TRUE       If we stopped the timer (if the timer is already stopped, we also return OS_TRUE)
*              OS_FALSE      If not
************************************************************************************************************************
*/

#if OS_TMR_EN > 0u
BOOLEAN  OSTmrStop (OS_TMR  *ptmr,
                    INT8U    opt,
                    void    *callback_arg,
                    INT8U   *perr)
{
    OS_TMR_CALLBACK  pfnct;


#ifdef OS_SAFETY_CRITICAL
    if (perr == (INT8U *)0) {
        OS_SAFETY_CRITICAL_EXCEPTION();
    }
#endif

#if OS_ARG_CHK_EN > 0u
    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 > 0u) {                                      /* See if trying to call from an ISR                */
        *perr  = OS_ERR_TMR_ISR;
        return (OS_FALSE);
    }
    OSSchedLock();
    switch (ptmr->OSTmrState) {
        case OS_TMR_STATE_RUNNING:
             OSTmr_Unlink(ptmr);                                  /* Remove from current wheel spoke                  */
             *perr = OS_ERR_NONE;
             switch (opt) {
                 case OS_TMR_OPT_CALLBACK:
                      pfnct = ptmr->OSTmrCallback;                /* Execute callback function if available ...       */
                      if (pfnct != (OS_TMR_CALLBACK)0) {
                          (*pfnct)((void *)ptmr, ptmr->OSTmrCallbackArg);  /* Use callback arg when timer was created */
                      } else {
                          *perr = OS_ERR_TMR_NO_CALLBACK;
                      }
                      break;

                 case OS_TMR_OPT_CALLBACK_ARG:
                      pfnct = ptmr->OSTmrCallback;                /* Execute callback function if available ...       */
                      if (pfnct != (OS_TMR_CALLBACK)0) {
                          (*pfnct)((void *)ptmr, callback_arg);   /* ... using the 'callback_arg' provided in call    */
                      } else {
                          *perr = OS_ERR_TMR_NO_CALLBACK;
                      }
                      break;

                 case OS_TMR_OPT_NONE:
                      break;

                 default:
                     *perr = OS_ERR_TMR_INVALID_OPT;
                     break;
             }
             OSSchedUnlock();
             return (OS_TRUE);

        case OS_TMR_STATE_COMPLETED:                              /* Timer has already completed the ONE-SHOT or ...  */
        case OS_TMR_STATE_STOPPED:                                /* ... timer has not started yet.                   */
             OSSchedUnlock();
             *perr = OS_ERR_TMR_STOPPED;
             return (OS_TRUE);

        case OS_TMR_STATE_UNUSED:                                 /* Timer was not created                            */
             OSSchedUnlock();
             *perr = OS_ERR_TMR_INACTIVE;
             return (OS_FALSE);

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

/*$PAGE*/
/*
************************************************************************************************************************
*                                      SIGNAL THAT IT'S TIME TO UPDATE THE TIMERS
*
* Description: This function is typically called by the ISR that occurs at the timer tick rate and is used to signal to
*              OSTmr_Task() that it's time to update the timers.
*
* Arguments  : none
*
* Returns    : OS_ERR_NONE         The call was successful and the timer task was signaled.
*              OS_ERR_SEM_OVF      If OSTmrSignal() was called more often than OSTmr_Task() can handle the timers.
*                                  This would indicate that your system is heavily loaded.
*              OS_ERR_EVENT_TYPE   Unlikely you would get this error because the semaphore used for signaling is created
*                                  by uC/OS-II.
*              OS_ERR_PEVENT_NULL  Again, unlikely you would ever get this error because the semaphore used for signaling
*                                  is created by uC/OS-II.
************************************************************************************************************************
*/

#if OS_TMR_EN > 0u

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久婷婷一区二区三区| 亚洲欧美在线另类| 91蝌蚪porny| 琪琪一区二区三区| 中文字幕一区不卡| 欧美不卡一二三| 欧洲av在线精品| 国产精品一区二区果冻传媒| 亚洲成人动漫在线免费观看| 国产精品色婷婷久久58| 欧美一级日韩免费不卡| 色先锋aa成人| 国产成都精品91一区二区三| 人人爽香蕉精品| 亚洲妇女屁股眼交7| 日韩理论片在线| 久久免费看少妇高潮| 欧美男女性生活在线直播观看| 99久精品国产| av激情综合网| 成人aaaa免费全部观看| 国产乱人伦偷精品视频免下载| 奇米一区二区三区| 日韩在线一区二区| 一级日本不卡的影视| 国产精品久久看| 国产欧美日韩久久| 久久亚洲免费视频| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 美女网站视频久久| 午夜视频一区二区| 亚洲国产精品嫩草影院| 亚洲精品你懂的| 亚洲免费av高清| 亚洲男人的天堂在线aⅴ视频| 国产精品久久毛片| 亚洲欧美一区二区在线观看| 国产精品无码永久免费888| 久久色在线视频| 日韩欧美成人激情| 久久欧美一区二区| 久久精品人人做人人爽97 | 调教+趴+乳夹+国产+精品| 亚洲自拍与偷拍| 亚洲一级二级三级在线免费观看| 亚洲精品视频在线| 亚洲一本大道在线| 日韩国产一二三区| 精品一区免费av| 国产精品一区免费视频| 国产精品1区2区| 成人美女视频在线看| 色综合久久中文字幕| 欧美午夜片在线看| 欧美一级专区免费大片| 精品区一区二区| 久久久久久久久久久久久女国产乱 | 成人黄色小视频在线观看| 成人黄色综合网站| 欧美伊人精品成人久久综合97| 欧美色综合久久| 91精品国产乱码久久蜜臀| 精品欧美乱码久久久久久1区2区| 久久亚洲捆绑美女| 亚洲美女在线国产| 日本系列欧美系列| 懂色av一区二区夜夜嗨| 日本韩国一区二区三区| 日韩欧美国产电影| 中文字幕 久热精品 视频在线| 国产精品久久久久久久岛一牛影视| 一区二区三区四区在线播放| 日精品一区二区三区| 国产精品一区久久久久| 色婷婷精品久久二区二区蜜臂av| 欧美二区三区91| 久久亚洲私人国产精品va媚药| 国产精品美女久久久久久2018 | 国产凹凸在线观看一区二区| 91在线观看美女| 欧美一区二区三区人| 亚洲国产精品成人综合| 亚洲影院免费观看| 国产成人免费xxxxxxxx| 欧美日韩大陆在线| 欧美激情中文字幕| 视频一区在线播放| 成人黄色一级视频| 日韩欧美另类在线| 亚洲在线视频免费观看| 国产成人一区在线| 91精品国产一区二区三区| 国产精品久久久久久福利一牛影视 | 日韩欧美一级精品久久| 一区二区三区在线视频免费观看| 久久国产免费看| 在线免费观看不卡av| 久久女同性恋中文字幕| 天天综合网天天综合色| 99久久国产免费看| 久久精品一级爱片| 久久国产夜色精品鲁鲁99| 在线区一区二视频| 国产精品热久久久久夜色精品三区 | 国产精品乱人伦中文| 免费高清在线视频一区·| 色8久久精品久久久久久蜜| 久久色在线观看| 男女激情视频一区| 在线视频欧美区| 国产精品国产三级国产普通话99| 捆绑调教美女网站视频一区| 欧美日韩久久久一区| 亚洲免费在线观看| 粉嫩av一区二区三区在线播放| 精品日产卡一卡二卡麻豆| 日韩高清不卡一区二区| 在线视频国内一区二区| 亚洲情趣在线观看| 成人精品国产一区二区4080| 国产日产亚洲精品系列| 狠狠色丁香久久婷婷综合_中| 欧美日韩卡一卡二| 亚洲国产成人91porn| 91国产成人在线| 一区二区三区不卡视频在线观看 | 99久久久免费精品国产一区二区 | 亚洲日穴在线视频| 不卡区在线中文字幕| 中文字幕高清不卡| 国产成人免费视频精品含羞草妖精| 精品处破学生在线二十三| 久久99国产精品久久99果冻传媒| 91精品国产综合久久久久| 日韩av一二三| 精品三级av在线| 国产一区二区三区黄视频| 欧美精品一区二区三区在线播放 | 久久久噜噜噜久久中文字幕色伊伊 | 日本一不卡视频| 日韩欧美国产成人一区二区| 看电视剧不卡顿的网站| 欧美一级日韩一级| 国内偷窥港台综合视频在线播放| 久久综合九色欧美综合狠狠| 国产精品538一区二区在线| 欧美韩国日本综合| 成人美女视频在线观看| 亚洲欧美成aⅴ人在线观看 | 日韩亚洲欧美成人一区| 免费成人在线观看| 久久久久国产一区二区三区四区| 国产精品一区二区三区四区| 国产精品系列在线| 91久久一区二区| 丝袜a∨在线一区二区三区不卡| 日韩三级在线免费观看| 国产一区免费电影| 17c精品麻豆一区二区免费| 日本高清不卡视频| 免费日韩伦理电影| 国产欧美精品区一区二区三区| jlzzjlzz亚洲女人18| 亚洲综合区在线| 精品久久人人做人人爽| av一区二区三区| 五月天一区二区| 精品理论电影在线观看 | 91老师片黄在线观看| 偷偷要91色婷婷| 国产女人18毛片水真多成人如厕 | 欧美激情中文不卡| 在线精品国精品国产尤物884a| 日日摸夜夜添夜夜添亚洲女人| 久久亚洲精精品中文字幕早川悠里 | 欧美电影一区二区| 国产精品自拍av| 一区二区三区高清在线| 26uuu久久综合| 欧美亚洲免费在线一区| 国产一区二区三区四区在线观看| 中文字幕亚洲精品在线观看| 欧美日韩在线亚洲一区蜜芽| 国产精品18久久久久久久久久久久 | 国产精品嫩草影院com| 欧美亚洲国产一卡| 丁香网亚洲国际| 日本成人在线看| 亚洲另类春色国产| 久久久精品中文字幕麻豆发布| 欧洲一区在线电影| 国产福利精品一区二区| 日韩激情av在线| 亚洲免费在线观看视频| 久久精品视频一区| 91精品在线免费| 欧美影院一区二区| www.久久久久久久久| 国产在线精品一区二区| 午夜久久久影院|