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

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

?? os_core.c

?? ucos-ii 的完整代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
*
* Arguments  : none
*
* Returns    : none
*
* Notes      : 1) This function should be called ith interrupts already disabled
*              2) Your ISR can directly increment OSIntNesting without calling this function because
*                 OSIntNesting has been declared 'global'.
*              3) You MUST still call OSIntExit() even though you increment OSIntNesting directly.
*              4) You MUST invoke OSIntEnter() and OSIntExit() in pair.  In other words, for every call
*                 to OSIntEnter() at the beginning of the ISR you MUST have a call to OSIntExit() at the
*                 end of the ISR.
*              5) You are allowed to nest interrupts up to 255 levels deep.
*              6) I removed the OS_ENTER_CRITICAL() and OS_EXIT_CRITICAL() around the increment because
*                 OSIntEnter() is always called with interrupts disabled.
*********************************************************************************************************
*/

void  OSIntEnter (void)
{
    if (OSRunning == OS_TRUE) {
        if (OSIntNesting < 255u) {
            OSIntNesting++;                      /* Increment ISR nesting level                        */
        }
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                               EXIT ISR
*
* Description: This function is used to notify uC/OS-II that you have completed serviving an ISR.  When
*              the last nested ISR has completed, uC/OS-II will call the scheduler to determine whether
*              a new, high-priority task, is ready to run.
*
* Arguments  : none
*
* Returns    : none
*
* Notes      : 1) You MUST invoke OSIntEnter() and OSIntExit() in pair.  In other words, for every call
*                 to OSIntEnter() at the beginning of the ISR you MUST have a call to OSIntExit() at the
*                 end of the ISR.
*              2) Rescheduling is prevented when the scheduler is locked (see OS_SchedLock())
*********************************************************************************************************
*/

void  OSIntExit (void)
{
#if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register */
    OS_CPU_SR  cpu_sr = 0;
#endif



    if (OSRunning == OS_TRUE) {
        OS_ENTER_CRITICAL();
        if (OSIntNesting > 0) {                            /* Prevent OSIntNesting from wrapping       */
            OSIntNesting--;
        }
        if (OSIntNesting == 0) {                           /* Reschedule only if all ISRs complete ... */
            if (OSLockNesting == 0) {                      /* ... and not locked.                      */
                OS_SchedNew();
                if (OSPrioHighRdy != OSPrioCur) {          /* No Ctx Sw if current task is highest rdy */
                    OSTCBHighRdy  = OSTCBPrioTbl[OSPrioHighRdy];
#if OS_TASK_PROFILE_EN > 0
                    OSTCBHighRdy->OSTCBCtxSwCtr++;         /* Inc. # of context switches to this task  */
#endif
                    OSCtxSwCtr++;                          /* Keep track of the number of ctx switches */
                    OSIntCtxSw();                          /* Perform interrupt level ctx switch       */
                }
            }
        }
        OS_EXIT_CRITICAL();
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                          PREVENT SCHEDULING
*
* Description: This function is used to prevent rescheduling to take place.  This allows your application
*              to prevent context switches until you are ready to permit context switching.
*
* Arguments  : none
*
* Returns    : none
*
* Notes      : 1) You MUST invoke OSSchedLock() and OSSchedUnlock() in pair.  In other words, for every
*                 call to OSSchedLock() you MUST have a call to OSSchedUnlock().
*********************************************************************************************************
*/

#if OS_SCHED_LOCK_EN > 0
void  OSSchedLock (void)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#endif



    if (OSRunning == OS_TRUE) {                  /* Make sure multitasking is running                  */
        OS_ENTER_CRITICAL();
        if (OSIntNesting == 0) {                 /* Can't call from an ISR                             */
            if (OSLockNesting < 255u) {          /* Prevent OSLockNesting from wrapping back to 0      */
                OSLockNesting++;                 /* Increment lock nesting level                       */
            }
        }
        OS_EXIT_CRITICAL();
    }
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                          ENABLE SCHEDULING
*
* Description: This function is used to re-allow rescheduling.
*
* Arguments  : none
*
* Returns    : none
*
* Notes      : 1) You MUST invoke OSSchedLock() and OSSchedUnlock() in pair.  In other words, for every
*                 call to OSSchedLock() you MUST have a call to OSSchedUnlock().
*********************************************************************************************************
*/

#if OS_SCHED_LOCK_EN > 0
void  OSSchedUnlock (void)
{
#if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register */
    OS_CPU_SR  cpu_sr = 0;
#endif



    if (OSRunning == OS_TRUE) {                            /* Make sure multitasking is running        */
        OS_ENTER_CRITICAL();
        if (OSLockNesting > 0) {                           /* Do not decrement if already 0            */
            OSLockNesting--;                               /* Decrement lock nesting level             */
            if (OSLockNesting == 0) {                      /* See if scheduler is enabled and ...      */
                if (OSIntNesting == 0) {                   /* ... not in an ISR                        */
                    OS_EXIT_CRITICAL();
                    OS_Sched();                            /* See if a HPT is ready                    */
                } else {
                    OS_EXIT_CRITICAL();
                }
            } else {
                OS_EXIT_CRITICAL();
            }
        } else {
            OS_EXIT_CRITICAL();
        }
    }
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                          START MULTITASKING
*
* Description: This function is used to start the multitasking process which lets uC/OS-II manages the
*              task that you have created.  Before you can call OSStart(), you MUST have called OSInit()
*              and you MUST have created at least one task.
*
* Arguments  : none
*
* Returns    : none
*
* Note       : OSStartHighRdy() MUST:
*                 a) Call OSTaskSwHook() then,
*                 b) Set OSRunning to OS_TRUE.
*                 c) Load the context of the task pointed to by OSTCBHighRdy.
*                 d_ Execute the task.
*********************************************************************************************************
*/

void  OSStart (void)
{
    if (OSRunning == OS_FALSE) {
        OS_SchedNew();                               /* Find highest priority's task priority number   */
        OSPrioCur     = OSPrioHighRdy;
        OSTCBHighRdy  = OSTCBPrioTbl[OSPrioHighRdy]; /* Point to highest priority task ready to run    */
        OSTCBCur      = OSTCBHighRdy;
        OSStartHighRdy();                            /* Execute target specific code to start task     */
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                        STATISTICS INITIALIZATION
*
* Description: This function is called by your application to establish CPU usage by first determining
*              how high a 32-bit counter would count to in 1 second if no other tasks were to execute
*              during that time.  CPU usage is then determined by a low priority task which keeps track
*              of this 32-bit counter every second but this time, with other tasks running.  CPU usage is
*              determined by:
*
*                                             OSIdleCtr
*                 CPU Usage (%) = 100 * (1 - ------------)
*                                            OSIdleCtrMax
*
* Arguments  : none
*
* Returns    : none
*********************************************************************************************************
*/

#if OS_TASK_STAT_EN > 0
void  OSStatInit (void)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#endif



    OSTimeDly(2);                                /* Synchronize with clock tick                        */
    OS_ENTER_CRITICAL();
    OSIdleCtr    = 0L;                           /* Clear idle counter                                 */
    OS_EXIT_CRITICAL();
    OSTimeDly(OS_TICKS_PER_SEC / 10);            /* Determine MAX. idle counter value for 1/10 second  */
    OS_ENTER_CRITICAL();
    OSIdleCtrMax = OSIdleCtr;                    /* Store maximum idle counter count in 1/10 second    */
    OSStatRdy    = OS_TRUE;
    OS_EXIT_CRITICAL();
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                         PROCESS SYSTEM TICK
*
* Description: This function is used to signal to uC/OS-II the occurrence of a 'system tick' (also known
*              as a 'clock tick').  This function should be called by the ticker ISR but, can also be
*              called by a high priority task.
*
* Arguments  : none
*
* Returns    : none
*********************************************************************************************************
*/

void  OSTimeTick (void)
{
    OS_TCB    *ptcb;
#if OS_TICK_STEP_EN > 0
    BOOLEAN    step;
#endif
#if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register     */
    OS_CPU_SR  cpu_sr = 0;
#endif



#if OS_TIME_TICK_HOOK_EN > 0
    OSTimeTickHook();                                      /* Call user definable hook                     */
#endif
#if OS_TIME_GET_SET_EN > 0
    OS_ENTER_CRITICAL();                                   /* Update the 32-bit tick counter               */
    OSTime++;
    OS_EXIT_CRITICAL();
#endif
    if (OSRunning == OS_TRUE) {
#if OS_TICK_STEP_EN > 0
        switch (OSTickStepState) {                         /* Determine whether we need to process a tick  */
            case OS_TICK_STEP_DIS:                         /* Yes, stepping is disabled                    */
                 step = OS_TRUE;
                 break;

            case OS_TICK_STEP_WAIT:                        /* No,  waiting for uC/OS-View to set ...       */
                 step = OS_FALSE;                          /*      .. OSTickStepState to OS_TICK_STEP_ONCE */
                 break;

            case OS_TICK_STEP_ONCE:                        /* Yes, process tick once and wait for next ... */
                 step            = OS_TRUE;                /*      ... step command from uC/OS-View        */
                 OSTickStepState = OS_TICK_STEP_WAIT;
                 break;

            default:                                       /* Invalid case, correct situation              */
                 step            = OS_TRUE;
                 OSTickStepState = OS_TICK_STEP_DIS;
                 break;
        }
        if (step == OS_FALSE) {                            /* Return if waiting for step command           */
            return;
        }
#endif
        ptcb = OSTCBList;                                  /* Point at first TCB in TCB list               */
        while (ptcb->OSTCBPrio != OS_TASK_IDLE_PRIO) {     /* Go through all TCBs in TCB list              */
            OS_ENTER_CRITICAL();
            if (ptcb->OSTCBDly != 0) {                     /* No, Delayed or waiting for event with TO     */
                if (--ptcb->OSTCBDly == 0) {               /* Decrement nbr of ticks to end of delay       */
                                                           /* Check for timeout                            */
                    if ((ptcb->OSTCBStat & OS_STAT_PEND_ANY) != OS_STAT_RDY) {
                        ptcb->OSTCBStat  &= ~(INT8U)OS_STAT_PEND_ANY;          /* Yes, Clear status flag   */
                        ptcb->OSTCBStatPend = OS_STAT_PEND_TO;                 /* Indicate PEND timeout    */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲女女做受ⅹxx高潮| 成人黄页在线观看| 成人18精品视频| 91精品国产aⅴ一区二区| 亚洲色图.com| 成人午夜精品在线| 精品国产髙清在线看国产毛片| 亚洲美女屁股眼交3| 国产一区二区视频在线播放| 欧美精品日韩精品| 亚洲一线二线三线久久久| 国产精品资源在线看| 欧美一区二区美女| 亚洲18女电影在线观看| 一道本成人在线| 一区免费观看视频| 丁香亚洲综合激情啪啪综合| 日韩精品最新网址| 久久精品99久久久| 欧美不卡一二三| 免费看精品久久片| 日韩一区二区在线观看| 奇米精品一区二区三区四区| 欧美乱熟臀69xxxxxx| 亚洲成av人**亚洲成av**| 色欧美片视频在线观看| 亚洲视频一区二区免费在线观看| 国产成人福利片| 国产精品色在线观看| 粉嫩一区二区三区在线看| 国产人成亚洲第一网站在线播放 | 日韩欧美国产三级电影视频| 亚洲va欧美va人人爽| 欧美精品色一区二区三区| 亚洲成人av中文| 5566中文字幕一区二区电影| 偷拍与自拍一区| 91精品国产高清一区二区三区蜜臀| 亚洲国产美女搞黄色| 在线成人免费视频| 蜜桃精品视频在线| 国产日韩精品久久久| 99久久99久久精品国产片果冻| 综合电影一区二区三区| 91传媒视频在线播放| 天堂蜜桃一区二区三区| 欧美电影免费观看高清完整版 | 日本成人在线网站| 日韩午夜在线影院| 国产麻豆成人精品| 亚洲欧洲99久久| 欧美日韩视频在线第一区| 男女性色大片免费观看一区二区 | 国产一区二区福利视频| 国产女人aaa级久久久级| thepron国产精品| 亚洲一区二区在线免费看| 欧美一二三在线| 丁香激情综合五月| 亚洲国产成人91porn| 欧美tickling挠脚心丨vk| www.在线成人| 蜜桃av一区二区| 亚洲欧美日韩久久| 91精品国产综合久久久久久漫画| 国产一区二区福利视频| 一区二区三区欧美日韩| 欧美电影免费观看高清完整版在 | 亚洲毛片av在线| 欧美成人一区二区三区在线观看| 成人午夜视频福利| 日一区二区三区| 国产精品久久二区二区| 日韩欧美中文一区二区| 91欧美一区二区| 国产自产v一区二区三区c| 一区二区在线观看不卡| 久久亚洲私人国产精品va媚药| 色综合视频在线观看| 国产一区二区三区免费播放| 亚洲免费在线播放| 国产日本欧洲亚洲| 日韩欧美成人激情| 欧美撒尿777hd撒尿| av电影天堂一区二区在线| 麻豆中文一区二区| 香蕉久久夜色精品国产使用方法| 日本一区二区高清| 欧美精品一区二区三区高清aⅴ | 久久久久久日产精品| 欧美日韩国产综合视频在线观看| av综合在线播放| 国产精品亚洲一区二区三区在线| 日本不卡免费在线视频| 亚洲曰韩产成在线| 亚洲色欲色欲www| 国产精品亲子乱子伦xxxx裸| 久久久国产综合精品女国产盗摄| 欧美精品xxxxbbbb| 欧美人与性动xxxx| 欧美色图一区二区三区| 一本大道久久a久久综合| 成人一区在线观看| 国产成a人亚洲精品| 国产精品小仙女| 国产精品中文有码| 国产精品一区2区| 国产精品一线二线三线| 九色|91porny| 国产一区二区三区精品视频| 久久狠狠亚洲综合| 狠狠久久亚洲欧美| 国产美女精品人人做人人爽| 久久99久久久久久久久久久| 蜜臀久久久久久久| 麻豆国产精品视频| 精品一二三四在线| 国产成人啪午夜精品网站男同| 国内精品伊人久久久久影院对白| 麻豆一区二区在线| 国产福利一区在线| 成人av在线网站| 91猫先生在线| 欧美麻豆精品久久久久久| 91精品国产综合久久精品app | 欧美经典一区二区| 亚洲欧洲精品一区二区三区| 亚洲欧美激情小说另类| 亚洲午夜国产一区99re久久| 日日骚欧美日韩| 国产呦萝稀缺另类资源| 国产suv精品一区二区6| 99免费精品在线观看| 欧美日韩精品一区二区天天拍小说| 91精品国产一区二区| 久久久九九九九| 亚洲另类春色国产| 免费黄网站欧美| 成人国产亚洲欧美成人综合网| 91看片淫黄大片一级| 91精品国产乱码久久蜜臀| 国产人成亚洲第一网站在线播放| 亚洲精品欧美二区三区中文字幕| 午夜影视日本亚洲欧洲精品| 国产一区二区91| 欧美性高清videossexo| 久久一二三国产| 亚洲激情在线激情| 国产一区二区三区四| 在线免费观看成人短视频| 久久先锋影音av鲁色资源网| 亚洲欧洲制服丝袜| 久久国产剧场电影| 色94色欧美sute亚洲13| 久久这里只有精品首页| 一区二区三区精品| 国产成a人亚洲精| 欧美日本在线看| 国产精品久久久久久亚洲毛片 | 国产网站一区二区| 性做久久久久久| 成人综合婷婷国产精品久久免费| 欧美日本不卡视频| 亚洲天堂2014| 国产成a人无v码亚洲福利| 欧美丰满一区二区免费视频| 中文字幕亚洲一区二区va在线| 蜜桃视频第一区免费观看| 91行情网站电视在线观看高清版| 欧美精品一区二区在线观看| 首页国产丝袜综合| 色综合久久久网| 国产精品素人视频| 寂寞少妇一区二区三区| 777奇米四色成人影色区| 亚洲另类中文字| 成人国产亚洲欧美成人综合网| 欧美大片在线观看一区二区| 亚洲国产日韩a在线播放性色| 成人黄色国产精品网站大全在线免费观看 | 激情综合色播激情啊| 在线综合亚洲欧美在线视频| 一区二区三区免费网站| 播五月开心婷婷综合| 国产欧美视频在线观看| 黄色日韩网站视频| 日韩午夜av电影| 日韩不卡手机在线v区| 欧美日韩国产天堂| 樱花草国产18久久久久| 91麻豆精品秘密| 亚洲欧美成人一区二区三区| 91日韩精品一区| 亚洲免费观看视频| 91在线精品一区二区三区| 亚洲欧洲av在线| 91福利视频网站| 亚洲一区二区三区四区在线免费观看 | 97久久精品人人做人人爽| 国产精品久久久久久久午夜片|