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

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

?? os_core.c

?? uc/osII基于51單片機的時鐘
?? C
?? 第 1 頁 / 共 3 頁
字號:

	/* Initialize the memory manager            */
#if OS_MEM_EN && OS_MAX_MEM_PART >= 2
    OSMemInit();                                           
#endif    

	/* creat OSTaskIdle task */
#if OS_STK_GROWTH == 1
    #if OS_TASK_CREATE_EXT_EN
    OSTaskCreateExt(OSTaskIdle, 
                    (void DT_XDATA *)0,                                 /* No arguments passed to OSTaskIdle()  */
                    &OSTaskIdleStk[OS_TASK_IDLE_STK_SIZE - 1], /* Set Top-Of-Stack                     */
                    OS_IDLE_PRIO,                              /* Lowest priority level                */
                    OS_TASK_IDLE_ID,
                    &OSTaskIdleStk[0],                         /* Set Bottom-Of-Stack                  */
                    OS_TASK_IDLE_STK_SIZE, 
                    (void DT_XDATA *)0,                                 /* No TCB extension                     */
                    OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);/* Enable stack checking + clear stack  */
    #else
    OSTaskCreate(OSTaskIdle, (void DT_XDATA *)0, &OSTaskIdleStk[OS_TASK_IDLE_STK_SIZE - 1], OS_IDLE_PRIO);	/* OS_IDLE _PROIO == OS_LOWEST_PROIO */
    #endif
#else
    #if OS_TASK_CREATE_EXT_EN
    OSTaskCreateExt(OSTaskIdle, 
                    (void DT_XDATA *)0,                                 /* No arguments passed to OSTaskIdle()  */
                    &OSTaskIdleStk[0],                         /* Set Top-Of-Stack                     */
                    OS_IDLE_PRIO,                              /* Lowest priority level                */
                    OS_TASK_IDLE_ID,
                    &OSTaskIdleStk[OS_TASK_IDLE_STK_SIZE - 1], /* Set Bottom-Of-Stack                  */
                    OS_TASK_IDLE_STK_SIZE, 
                    (void DT_XDATA *)0,                                 /* No TCB extension                     */
                    OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);/* Enable stack checking + clear stack  */
    #else
    OSTaskCreate(OSTaskIdle, (void DT_XDATA *)0, &OSTaskIdleStk[0], OS_IDLE_PRIO);
    #endif
#endif

#if OS_TASK_STAT_EN 
    #if OS_TASK_CREATE_EXT_EN
        #if OS_STK_GROWTH == 1
        OSTaskCreateExt(OSTaskStat, 
                        (void DT_XDATA *)0,                                /* No args passed to OSTaskStat()    */
                        &OSTaskStatStk[OS_TASK_STAT_STK_SIZE - 1],/* Set Top-Of-Stack                  */
                        OS_STAT_PRIO,                             /* One higher than the idle task     */
                        OS_TASK_STAT_ID,
                        &OSTaskStatStk[0],                        /* Set Bottom-Of-Stack               */
                        OS_TASK_STAT_STK_SIZE, 
                        (void DT_XDATA *)0,                                /* No TCB extension                  */
                        OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);  /* Enable stack checking + clear  */
        #else
        OSTaskCreateExt(OSTaskStat, 
                        (void DT_XDATA *)0,                                /* No args passed to OSTaskStat()    */
                        &OSTaskStatStk[0],                        /* Set Top-Of-Stack                  */
                        OS_STAT_PRIO,                             /* One higher than the idle task     */
                        OS_TASK_STAT_ID,
                        &OSTaskStatStk[OS_TASK_STAT_STK_SIZE - 1],/* Set Bottom-Of-Stack               */
                        OS_TASK_STAT_STK_SIZE, 
                        (void DT_XDATA *)0,                                /* No TCB extension                  */
                        OS_TASK_OPT_STK_CHK | OS_TASK_OPT_STK_CLR);  /* Enable stack checking + clear  */
        #endif
    #else
        #if OS_STK_GROWTH == 1
        OSTaskCreate(OSTaskStat, 
                     (void DT_XDATA *)0,                                   /* No args passed to OSTaskStat()    */
                     &OSTaskStatStk[OS_TASK_STAT_STK_SIZE - 1],   /* Set Top-Of-Stack                  */
                     OS_STAT_PRIO);                               /* One higher than the idle task     */
        #else
        OSTaskCreate(OSTaskStat, 
                     (void DT_XDATA *)0,                                   /* No args passed to OSTaskStat()    */
                     &OSTaskStatStk[0],                           /* Set Top-Of-Stack                  */
                     OS_STAT_PRIO);                               /* One higher than the idle task     */
        #endif
    #endif
#endif
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                              ENTER ISR
*
* Description: This function is used to notify uC/OS-II that you are about to service an interrupt
*              service routine (ISR).  This allows uC/OS-II to keep track of interrupt nesting and thus
*              only perform rescheduling at the last nested ISR.
*
* Arguments  : none
*
* Returns    : none
*
* Notes      : 1) Your ISR can directly increment OSIntNesting without calling this function because 
*                 OSIntNesting has been declared 'global'.  You MUST, however, be sure that the increment
*                 is performed 'indivisibly' by your processor to ensure proper access to this critical
*                 resource.
*              2) You MUST still call OSIntExit() even though you increment OSIntNesting directly.
*              3) 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.
*********************************************************************************************************
*/

void OSIntEnter (void) REENTRANT
{
    OS_ENTER_CRITICAL();
    OSIntNesting++;                              /* Increment ISR nesting level                        */
    OS_EXIT_CRITICAL();
}
/*$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 OSSchedLock())
*********************************************************************************************************
*/

void OSIntExit (void) REENTRANT
{
    OS_ENTER_CRITICAL();
    if ((--OSIntNesting | OSLockNesting) == 0) { /* Reschedule only if all ISRs completed & not locked */
        OSIntExitY    = OSUnMapTbl[OSRdyGrp];
        OSPrioHighRdy = (INT8U)((OSIntExitY << 3) + OSUnMapTbl[OSRdyTbl[OSIntExitY]]);
        if (OSPrioHighRdy != OSPrioCur) {        /* No context switch if current task is highest ready */
            OSTCBHighRdy  = OSTCBPrioTbl[OSPrioHighRdy];
            OSCtxSwCtr++;                        /* Keep track of the number of context switches       */
            OSIntCtxSw();                        /* Perform interrupt level context switch             */
        }
    }
    OS_EXIT_CRITICAL();
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                              SCHEDULER
*
* Description: This function is called by other uC/OS-II services to determine whether a new, high
*              priority task has been made ready to run.  This function is invoked by TASK level code
*              and is not used to reschedule tasks from ISRs (see OSIntExit() for ISR rescheduling).
*
* Arguments  : none
*
* Returns    : none
*
* Notes      : 1) This function is INTERNAL to uC/OS-II and your application should not call it.
*              2) Rescheduling is prevented when the scheduler is locked (see OSSchedLock())
*********************************************************************************************************
*/

void OSSched (void) REENTRANT
{
    INT8U y;


    OS_ENTER_CRITICAL();
    if ((OSLockNesting | OSIntNesting) == 0) {   /* Task scheduling must be enabled and not ISR level  */
        y             = OSUnMapTbl[OSRdyGrp];    /* Get pointer to highest priority task ready to run  */
        OSPrioHighRdy = (INT8U)((y << 3) + OSUnMapTbl[OSRdyTbl[y]]);
        if (OSPrioHighRdy != OSPrioCur) {         /* No context switch if current task is highest ready */
            OSTCBHighRdy = OSTCBPrioTbl[OSPrioHighRdy];
            OSCtxSwCtr++;                        /* Increment context switch counter                   */
            OS_TASK_SW();                        /* Perform a context 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().
*********************************************************************************************************
*/

void OSSchedLock (void) REENTRANT
{
    if (OSRunning == TRUE) {                     /* Make sure multitasking is running                  */
        OS_ENTER_CRITICAL();
        OSLockNesting++;                         /* Increment lock nesting level                       */
        OS_EXIT_CRITICAL();
    }
}
/*$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().
*********************************************************************************************************
*/

void OSSchedUnlock (void) REENTRANT
{
    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 | OSIntNesting) == 0) { /* See if scheduling re-enabled and not an ISR  */
                OS_EXIT_CRITICAL();
                OSSched();                             /* See if a higher priority task is ready       */
            } else {
                OS_EXIT_CRITICAL();
            }
        } else {
            OS_EXIT_CRITICAL();
        }
    }
}
/*$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.
*********************************************************************************************************
*/

/* refer to book P96 */
void OSStart (void) REENTRANT
{
    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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级在线免费| 五月天精品一区二区三区| 亚洲欧洲日韩在线| 视频在线观看一区二区三区| 成人免费的视频| 91精品一区二区三区久久久久久| 国产精品国产a| 精品一区二区三区久久| 色婷婷久久久久swag精品| 久久精品这里都是精品| 无吗不卡中文字幕| 色婷婷亚洲精品| 中文字幕高清一区| 毛片av一区二区三区| 在线免费亚洲电影| 国产精品免费aⅴ片在线观看| 日本美女一区二区三区视频| 欧美亚洲一区二区三区四区| 国产精品成人一区二区三区夜夜夜| 久久福利资源站| 在线播放亚洲一区| 亚洲一区在线视频| 色狠狠综合天天综合综合| 国产精品国产三级国产普通话三级| 久久国产尿小便嘘嘘| 欧美一区二区三区婷婷月色| 亚洲香蕉伊在人在线观| 91福利资源站| 亚洲综合清纯丝袜自拍| 欧美最猛黑人xxxxx猛交| 亚洲日本护士毛茸茸| 成人毛片在线观看| 中文字幕在线观看一区| 不卡的av中国片| 亚洲欧洲日产国码二区| 成人毛片老司机大片| 国产精品乱人伦| fc2成人免费人成在线观看播放| 久久新电视剧免费观看| 国产一区二区三区四区五区入口 | 久久九九影视网| 国产成a人亚洲| 综合网在线视频| 91国产免费观看| 日本亚洲最大的色成网站www| 欧美一区二区国产| 国产精品一区二区x88av| 中文字幕精品在线不卡| 91视视频在线观看入口直接观看www | 国产午夜久久久久| 大陆成人av片| 亚洲激情综合网| 91精品一区二区三区在线观看| 日韩av一级电影| 久久久久久久久久久久电影| 国产成人久久精品77777最新版本| 亚洲国产成人一区二区三区| 97se亚洲国产综合自在线| 亚洲国产日韩一级| 精品国产免费人成电影在线观看四季| 国产综合久久久久久久久久久久 | 国产乱子伦视频一区二区三区| 久久一区二区三区国产精品| 成人不卡免费av| 亚洲综合丁香婷婷六月香| 日韩女优av电影在线观看| 波多野结衣91| 日本中文一区二区三区| 国产三区在线成人av| 91福利小视频| 国产在线一区观看| 亚洲乱码国产乱码精品精小说| 欧美高清www午色夜在线视频| 美女视频网站黄色亚洲| 亚洲欧美在线aaa| 欧美一区二区日韩一区二区| 粉嫩av一区二区三区粉嫩| 亚洲成在人线免费| 日本一区二区在线不卡| 欧美色视频在线| 成人免费毛片片v| 偷拍自拍另类欧美| 国产精品视频九色porn| 91麻豆精品国产综合久久久久久| 成人av资源在线| 免费精品视频最新在线| 亚洲男女毛片无遮挡| 26uuu精品一区二区| 欧美日韩电影在线播放| 成人va在线观看| 狠狠色丁香婷婷综合久久片| 亚洲一区精品在线| 国产精品久久久久一区| 久久蜜桃一区二区| 91精品一区二区三区在线观看| 色婷婷国产精品| 成人免费毛片片v| 国产一区二区h| 久久99精品国产麻豆婷婷| 亚洲国产wwwccc36天堂| 亚洲精品成人少妇| 亚洲少妇30p| 中文字幕在线不卡一区| 久久久久久久综合日本| 337p日本欧洲亚洲大胆精品| 这里只有精品视频在线观看| 欧美日韩成人在线一区| 欧美性猛片xxxx免费看久爱| 91伊人久久大香线蕉| www.欧美色图| aaa欧美日韩| 99久久99久久精品免费观看| 丰满少妇在线播放bd日韩电影| 精品在线免费视频| 蜜臀av亚洲一区中文字幕| 免费欧美在线视频| 蜜桃av噜噜一区二区三区小说| 亚洲成人自拍网| 日本免费新一区视频| 久草热8精品视频在线观看| 秋霞国产午夜精品免费视频| 日日夜夜免费精品| 日日欢夜夜爽一区| 秋霞国产午夜精品免费视频| 蜜臀av性久久久久蜜臀aⅴ| 久久疯狂做爰流白浆xx| 国产乱淫av一区二区三区| 国产成人高清在线| 91在线免费看| 欧美视频一二三区| 日韩免费观看高清完整版在线观看| 欧美一卡二卡在线| 久久久精品免费网站| 国产欧美日韩中文久久| 亚洲乱码日产精品bd | 国产精品美女久久久久久久久久久 | 久久精品国产99| 国产在线国偷精品产拍免费yy| 国产乱人伦偷精品视频不卡| 成人激情小说乱人伦| 91豆麻精品91久久久久久| 欧美日韩国产精品自在自线| 精品国产一二三| 国产精品传媒入口麻豆| 婷婷夜色潮精品综合在线| 麻豆精品久久久| 成人午夜又粗又硬又大| 欧美亚洲国产怡红院影院| 日韩一区二区麻豆国产| 国产精品三级电影| 亚洲第一激情av| 国产成人免费网站| 欧美色倩网站大全免费| 久久精品欧美日韩| 一区二区三区中文字幕在线观看| 日本不卡中文字幕| 91在线视频免费91| 日韩精品中文字幕一区二区三区| 国产女人aaa级久久久级 | 久久精品这里都是精品| 一区二区在线观看av| 久久成人羞羞网站| 色综合天天做天天爱| 欧美大片免费久久精品三p| 国产精品久久久久久久裸模| 肉色丝袜一区二区| 色综合久久天天综合网| 精品国产乱子伦一区| 亚洲国产综合视频在线观看| 国产剧情一区二区| 欧美一区三区二区| 亚洲另类色综合网站| 国产一区二区三区在线观看精品| 欧美视频在线一区| 亚洲欧洲综合另类| 国产传媒久久文化传媒| 制服丝袜在线91| 亚洲一区二区五区| 91浏览器打开| 日本一区二区不卡视频| 久久99精品久久久久久| 91精品国产一区二区三区蜜臀| 国产精品国产三级国产aⅴ无密码| 精品一区二区综合| 在线播放日韩导航| 亚洲一区二区精品久久av| 99久久国产综合色|国产精品| 久久精品视频网| 国产在线不卡一卡二卡三卡四卡| 欧美一级久久久| 亚洲第一成人在线| 欧美视频你懂的| 亚洲午夜免费福利视频| 99国产精品久久久久久久久久久| 久久久夜色精品亚洲| 激情文学综合插| 精品成人在线观看| 国内精品伊人久久久久av一坑| 欧美电影免费观看完整版| 洋洋av久久久久久久一区|