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

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

?? os_core.c

?? 嵌入式實時操作系統uCOS-II源碼
?? C
?? 第 1 頁 / 共 5 頁
字號:

void  OSIntEnter (void)
{
    if (OSRunning == 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)
{
    INT8U      y;
#if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register */
    OS_CPU_SR  cpu_sr;
    
    

    cpu_sr = 0;                                            /* Prevent compiler warning                 */
#endif    
    if (OSRunning == 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.                      */
                y             = OSUnMapTbl[OSRdyGrp];          
                OSPrioHighRdy = (INT8U)((y << 3) + OSUnMapTbl[OSRdyTbl[y]]);
                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;
    
    

    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#endif    
    if (OSRunning == TRUE) {                     /* Make sure multitasking is running                  */
        OS_ENTER_CRITICAL();
        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;
    
    

    cpu_sr = 0;                                            /* Prevent compiler warning                 */
#endif    
    if (OSRunning == 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 TRUE.
*                 c) Load the context of the task pointed to by OSTCBHighRdy.
*                 d_ Execute the task.
*********************************************************************************************************
*/

void  OSStart (void)
{
    INT8U y;
    INT8U x;


    if (OSRunning == FALSE) {
        y             = OSUnMapTbl[OSRdyGrp];        /* Find highest priority's task priority number   */
        x             = OSUnMapTbl[OSRdyTbl[y]];
        OSPrioHighRdy = (INT8U)((y << 3) + x);
        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;
    
    

    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#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    = 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;



    cpu_sr = 0;                                            /* Prevent compiler warning                     */
#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 == 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 = TRUE;
                 break;

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

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

            default:                                       /* Invalid case, correct situation              */
                 step            = TRUE;
                 OSTickStepState = OS_TICK_STEP_DIS;
                 break;
        }
        if (step == FALSE) {                               /* Return if waiting for step command           */
            return;
        }
#endif
        ptcb = OSTCBList;                                  /* Point at first TCB in TCB list               */
        while (ptcb->OSTCBPrio != OS_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   &= ~OS_STAT_PEND_ANY;                /* Yes, Clear status flag   */
                        ptcb->OSTCBPendTO  = TRUE;                             /* Indicate PEND timeout    */
                    } else {
                        ptcb->OSTCBPendTO  = FALSE;
                    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成av人片一区二区| 国产在线不卡一区| 成人免费在线观看入口| 久久精品水蜜桃av综合天堂| 欧美zozo另类异族| 精品免费国产一区二区三区四区| 日韩午夜av电影| 日韩欧美不卡在线观看视频| 久久综合色一综合色88| 2023国产精华国产精品| 国产日本亚洲高清| 亚洲欧洲精品天堂一级| 亚洲综合色自拍一区| 日本成人在线不卡视频| 久久成人综合网| 色婷婷一区二区三区四区| 91丨九色porny丨蝌蚪| 在线视频国产一区| 欧美精品777| 久久久精品日韩欧美| 欧美国产日本视频| 一区二区三区四区不卡在线| 首页综合国产亚洲丝袜| 激情图区综合网| 99久久国产综合精品色伊| 欧美中文字幕一区二区三区| 欧美日韩国产高清一区二区| 精品对白一区国产伦| 亚洲欧洲精品成人久久奇米网 | 国产一区高清在线| 成人美女视频在线观看18| 在线免费观看日韩欧美| 亚洲欧美日韩国产综合在线| 一区二区三区不卡在线观看 | 日韩精品91亚洲二区在线观看| 麻豆国产一区二区| www.亚洲激情.com| 日韩手机在线导航| 亚洲人成伊人成综合网小说| 另类的小说在线视频另类成人小视频在线 | 亚洲国产成人一区二区三区| 亚洲国产日韩a在线播放| 国产精品系列在线观看| 日本道免费精品一区二区三区| 日韩免费视频一区| 一区二区不卡在线播放 | 欧美人妖巨大在线| 亚洲国产精品ⅴa在线观看| 亚洲第一久久影院| 99re免费视频精品全部| 精品噜噜噜噜久久久久久久久试看| 亚洲欧美在线高清| 国产精品一区二区三区99| 欧美日韩国产影片| 亚洲精品中文字幕乱码三区| 国产专区综合网| 欧美久久久一区| 樱花草国产18久久久久| 成人免费黄色在线| 26uuu欧美| 麻豆一区二区三区| 精品视频999| 一区二区三区四区在线| 9久草视频在线视频精品| 国产亚洲制服色| 黄页视频在线91| 欧美一区二区精品| 视频在线在亚洲| 欧美日韩一区二区三区高清| 一区二区三区精品在线观看| 99久久精品国产精品久久| 中文成人av在线| 丁香六月久久综合狠狠色| 国产日韩欧美高清在线| 国产成人在线免费观看| 久久久亚洲国产美女国产盗摄| 另类小说视频一区二区| 日韩一级在线观看| 蜜桃av噜噜一区| 精品欧美久久久| 国产伦精品一区二区三区免费迷| 欧美不卡一区二区三区| 国产乱人伦偷精品视频免下载| 久久这里只有精品6| 国产成人精品免费在线| 亚洲欧洲性图库| 在线亚洲欧美专区二区| 天堂蜜桃一区二区三区| 欧美大片在线观看| 国产精品亚洲午夜一区二区三区| 国产欧美日韩激情| 99re成人在线| 亚洲r级在线视频| 精品国产一区二区国模嫣然| 国产·精品毛片| 亚洲h精品动漫在线观看| 日韩一区二区三区精品视频| 国产一区999| 日韩美女啊v在线免费观看| 在线观看亚洲a| 蜜臀av亚洲一区中文字幕| 久久免费看少妇高潮| 99久久久国产精品| 青青草国产成人99久久| 国产亚洲综合色| 欧美吻胸吃奶大尺度电影| 另类人妖一区二区av| 亚洲视频一区在线| 日韩欧美在线观看一区二区三区| 国产精品主播直播| 一区二区三区在线视频观看 | 精品国产乱码久久久久久老虎| 国产成人鲁色资源国产91色综| 樱花影视一区二区| 精品国产乱码久久久久久久| 91麻豆免费观看| 另类小说一区二区三区| 亚洲精品福利视频网站| 26uuu亚洲综合色| 欧美性猛交xxxx乱大交退制版| 寂寞少妇一区二区三区| 亚洲一区二区三区三| 国产日本欧美一区二区| 欧美美女激情18p| 99久久精品国产毛片| 国产一区二区导航在线播放| 亚洲国产精品久久一线不卡| 欧美在线免费播放| 成人丝袜视频网| 精品亚洲成a人| 日本欧美一区二区三区| 亚洲午夜电影在线观看| 国产精品久久久久一区二区三区| 欧美一区二区三区精品| 欧美在线综合视频| 99国产精品久久久久久久久久久 | 国产精品中文字幕一区二区三区| 水野朝阳av一区二区三区| 亚洲精品老司机| 成人欧美一区二区三区白人| 久久精品人人做| 久久久久久免费毛片精品| 欧美一区二区三区视频在线观看| 欧美在线观看视频一区二区三区| zzijzzij亚洲日本少妇熟睡| 国产精品影视网| 国产一区二区导航在线播放| 久久国产视频网| 看电影不卡的网站| 蜜臀av性久久久久蜜臀aⅴ| 日欧美一区二区| 三级精品在线观看| 亚洲444eee在线观看| 亚洲国产精品久久久久婷婷884| 综合久久综合久久| 日韩理论片在线| 亚洲人成电影网站色mp4| 亚洲精品视频在线看| 亚洲视频免费在线| 一区二区三区免费看视频| 亚洲国产另类av| 日韩国产欧美在线播放| 美女被吸乳得到大胸91| 国产一区啦啦啦在线观看| 国产精品99久久久久| 成人福利电影精品一区二区在线观看| 成人免费视频网站在线观看| 99久久国产综合精品女不卡| 在线看一区二区| 日韩午夜小视频| 欧美经典一区二区| 亚洲欧美一区二区三区国产精品| 亚洲一区二区三区在线看| 性感美女极品91精品| 精品一二三四区| 99re8在线精品视频免费播放| 欧美体内she精视频| 欧美videos中文字幕| 国产精品久久久久四虎| 亚洲综合一区在线| 久久99久国产精品黄毛片色诱| 丰满岳乱妇一区二区三区| 91成人国产精品| 亚洲精品在线三区| 亚洲欧美日韩系列| 九色porny丨国产精品| 成人av集中营| 欧美一二三区在线| 国产精品色一区二区三区| 午夜精品久久久久久久久久| 国产一区二区视频在线| 精品国产一区二区三区av性色| 国产欧美日韩卡一| 日韩成人精品在线观看| 成人午夜短视频| 日韩欧美在线综合网| 亚洲精品乱码久久久久久 | 国产亚洲精品bt天堂精选| 亚洲自拍另类综合| 国产成人av电影在线|