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

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

?? os_core.c

?? 51系列單片機的uCOS-II原代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
* Returns    : none
*********************************************************************************************************
*/

#if OS_TASK_STAT_EN
void OSStatInit (void)reentrant
{
    OSTimeDly(2);                                /* Synchronize with clock tick                        */
    OS_ENTER_CRITICAL();
    OSIdleCtr    = 0L;                           /* Clear idle counter                                 */
    OS_EXIT_CRITICAL();
    OSTimeDly(OS_TICKS_PER_SEC);                 /* Determine MAX. idle counter value for 1 second     */
    OS_ENTER_CRITICAL();
    OSIdleCtrMax = OSIdleCtr;                    /* Store maximum idle counter count in 1 second       */
    OSStatRdy    = TRUE;
    OS_EXIT_CRITICAL();
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                              IDLE TASK
*
* Description: This task is internal to uC/OS-II and executes whenever no other higher priority tasks
*              executes because they are waiting for event(s) to occur.
*
* Arguments  : none
*
* Returns    : none
*********************************************************************************************************
*/
void OSTaskIdle (void *dataptr)reentrant
{
    //sendstring("\r\n空閑任務:");sendbyte(EA);   
    INT8U  i;
    dataptr = dataptr;    /* Prevent compiler warning for not using 'dataptr'     */
    //sendstring("\r\n空閑任務:");sendbyte(EA);
    OS_ENTER_CRITICAL();        
    OSIdleCtr++;
    OS_EXIT_CRITICAL();
    for(i=0;i<1;i++)
    {
      ;
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                            STATISTICS TASK
*
* Description: This task is internal to uC/OS-II and is used to compute some statistics about the
*              multitasking environment.  Specifically, OSTaskStat() computes the CPU usage.
*              CPU usage is determined by:
*
*                                          OSIdleCtr
*                 OSCPUUsage = 100 * (1 - ------------)     (units are in %)
*                                         OSIdleCtrMax
*
* Arguments  : dataptr     this pointer is not used at this time.
*
* Returns    : none
*
* Notes      : 1) This task runs at a priority level higher than the idle task.  In fact, it runs at the
*                 next higher priority, OS_IDLE_PRIO-1.
*              2) You can disable this task by setting the configuration #define OS_TASK_STAT_EN to 0.
*              3) We delay for 5 seconds in the beginning to allow the system to reach steady state and
*                 have all other tasks created before we do statistics.  You MUST have at least a delay
*                 of 2 seconds to allow for the system to establish the maximum value for the idle 
*                 counter.
*********************************************************************************************************
*/

#if OS_TASK_STAT_EN
void OSTaskStat (void *dataptr)reentrant
{
    INT32U run;
    INT8S  usage;
    
    
    dataptr = dataptr;                               /* Prevent compiler warning for not using 'dataptr'     */
    while (OSStatRdy == FALSE) {
        OSTimeDly(2 * OS_TICKS_PER_SEC);             /* Wait until statistic task is ready                 */
    }
    for (;;) {
        OS_ENTER_CRITICAL();
        OSIdleCtrRun = OSIdleCtr;                /* Obtain the of the idle counter for the past second */
        run          = OSIdleCtr;
        OSIdleCtr    = 0L;                       /* Reset the idle counter for the next second         */
        OS_EXIT_CRITICAL();
        if (OSIdleCtrMax > 0L) {
            usage = (INT8S)(100L - 100L * run / OSIdleCtrMax);
            if (usage > 100) {
                OSCPUUsage = 100;
            } else if (usage < 0) {
                OSCPUUsage =   0;
            } else {
                OSCPUUsage = usage;
            }
        } else {
            OSCPUUsage = 0;
        }
        OSTaskStatHook();                        /* Invoke user definable hook                         */
        OSTimeDly(OS_TICKS_PER_SEC);             /* Accumulate OSIdleCtr for the next second           */
    }
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                            INITIALIZE TCB
*
* Description: This function is internal to uC/OS-II and is used to initialize a Task Control Block when
*              a task is created (see OSTaskCreate() and OSTaskCreateExt()).
*
* Arguments  : prio          is the priority of the task being created
*
*              ptos          is a pointer to the task's top-of-stack assuming that the CPU registers
*                            have been placed on the stack.  Note that the top-of-stack corresponds to a 
*                            'high' memory location is OS_STK_GROWTH is set to 1 and a 'low' memory
*                            location if OS_STK_GROWTH is set to 0.  Note that stack growth is CPU
*                            specific.
*
*              pbos          is a pointer to the bottom of stack.  A NULL pointer is passed if called by
*                            'OSTaskCreate()'.
*
*              id            is the task's ID (0..65535)
*
*              stk_size      is the size of the stack (in 'stack units').  If the stack units are INT8Us
*                            then, 'stk_size' contains the number of bytes for the stack.  If the stack
*                            units are INT32Us then, the stack contains '4 * stk_size' bytes.  The stack
*                            units are established by the #define constant OS_STK which is CPU
*                            specific.  'stk_size' is 0 if called by 'OSTaskCreate()'.
*
*              pext          is a pointer to a user supplied memory area that is used to extend the task
*                            control block.  This allows you to store the contents of floating-point
*                            registers, MMU registers or anything else you could find useful during a 
*                            context switch.  You can even assign a name to each task and store this name
*                            in this TCB extension.  A NULL pointer is passed if called by OSTaskCreate().
*
*              opt           options as passed to 'OSTaskCreateExt()' or, 
*                            0 if called from 'OSTaskCreate()'.
*
* Returns    : OS_NO_ERR         if the call was successful
*              OS_NO_MORE_TCB    if there are no more free TCBs to be allocated and thus, the task cannot
*                                be created.
*
* Note       : This function is INTERNAL to uC/OS-II and your application should not call it.
*********************************************************************************************************
*/
static OS_TCB *ptcb11;
INT8U OSTCBInit (INT8U prio, 
	         OS_STK *ptos, 
	         OS_STK *pbos, 
	         INT16U id, 
	         INT16U stk_size, 
	         void *pext, 
	         INT16U opt)reentrant
{
    OS_ENTER_CRITICAL();
    ptcb11 = OSTCBFreeList;                                  /* Get a free TCB from the free TCB list    */
    if (ptcb11 != (OS_TCB *)0) {
        OSTCBFreeList        = ptcb11->OSTCBNext;            /* Update pointer to free TCB list          */
        OS_EXIT_CRITICAL();
        ptcb11->OSTCBStkPtr    = ptos;                       /* Load Stack pointer in TCB                */
        ptcb11->OSTCBPrio      = (INT8U)prio;                /* Load task priority into TCB              */
        ptcb11->OSTCBStat      = OS_STAT_RDY;                /* Task is ready to run                     */
        ptcb11->OSTCBDly       = 0;                          /* Task is not delayed                      */

#if OS_TASK_CREATE_EXT_EN        
        ptcb11->OSTCBExtPtr    = pext;                       /* Store pointer to TCB extension           */
        ptcb11->OSTCBStkSize   = stk_size;                   /* Store stack size                         */
        ptcb11->OSTCBStkBottom = pbos;                       /* Store pointer to bottom of stack         */
        ptcb11->OSTCBOpt       = opt;                        /* Store task options                       */
        ptcb11->OSTCBId        = id;                         /* Store task ID                            */
#else
        pext                 = pext;                       /* Prevent compiler warning if not used     */
        stk_size             = stk_size;
        pbos                 = pbos;
        opt                  = opt;
        id                   = id;
#endif

#if OS_TASK_DEL_EN        
        ptcb11->OSTCBDelReq    = OS_NO_ERR;
#endif

        ptcb11->OSTCBY         = prio >> 3;                  /* Pre-compute X, Y, BitX and BitY          */
        ptcb11->OSTCBBitY      = OSMapTbl[ptcb11->OSTCBY];
        ptcb11->OSTCBX         = prio & 0x07;
        ptcb11->OSTCBBitX      = OSMapTbl[ptcb11->OSTCBX];

#if     OS_MBOX_EN || (OS_Q_EN && (OS_MAX_QS >= 2)) || OS_Sem_EN
        ptcb11->OSTCBEventPtr  = (OS_EVENT *)0;              /* Task is not pending on an event          */
#endif

#if     OS_MBOX_EN || (OS_Q_EN && (OS_MAX_QS >= 2))
        ptcb11->OSTCBMsg       = (void *)0;                  /* No message received                      */
#endif

        OS_ENTER_CRITICAL();
        OSTCBPrioTbl[prio]   = ptcb11;
        ptcb11->OSTCBNext      = OSTCBList;                  /* Link into TCB chain                      */
        ptcb11->OSTCBPrev      = (OS_TCB *)0;
        if (OSTCBList != (OS_TCB *)0) {
            OSTCBList->OSTCBPrev = ptcb11;
        }
        OSTCBList               = ptcb11;
        OSRdyGrp               |= ptcb11->OSTCBBitY;         /* Make task ready to run                   */
        OSRdyTbl[ptcb11->OSTCBY] |= ptcb11->OSTCBBitX;
        OS_EXIT_CRITICAL();
        return (OS_NO_ERR);
    } else {
        OS_EXIT_CRITICAL();
        return (OS_NO_MORE_TCB);
    }
}
/*$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;


    OSTimeTickHook();                                      /* Call user definable hook                 */
    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) {                         /* Delayed or waiting for event with TO     */
            if (--ptcb->OSTCBDly == 0) {                   /* Decrement nbr of ticks to end of delay   */
                if (!(ptcb->OSTCBStat & OS_STAT_SUSPEND)) {    /* Is task suspended?                   */
                    OSRdyGrp               |= ptcb->OSTCBBitY; /* No,  Make task Rdy to Run (timed out)*/
                    OSRdyTbl[ptcb->OSTCBY] |= ptcb->OSTCBBitX;
                } else {                                       /* Yes, Leave 1 tick to prevent ...     */
                    ptcb->OSTCBDly = 1;                        /* ... loosing the task when the ...    */
                }                                              /* ... suspension is removed.           */
            }
        }
        ptcb = ptcb->OSTCBNext;                            /* Point at next TCB in TCB list            */
        OS_EXIT_CRITICAL();
    }
    OS_ENTER_CRITICAL();                                   /* Update the 32-bit tick counter           */
    OSTime++;
    OS_EXIT_CRITICAL();
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                             GET VERSION
*
* Description: This function is used to return the version number of uC/OS-II.  The returned value
*              corresponds to uC/OS-II's version number multiplied by 100.  In other words, version 2.00
*              would be returned as 200.
*
* Arguments  : none
*
* Returns    : the version number of uC/OS-II multiplied by 100.
*********************************************************************************************************
*/
#if  OS_VERSION_CHK_EN
INT16U OSVersion (void)reentrant
{
    return (OS_VERSION);
}
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品麻豆日日躁夜夜躁| 国产一区在线不卡| 欧美精品vⅰdeose4hd| 在线欧美日韩精品| 国产精品久久久久久久裸模| 午夜精品久久久久久久蜜桃app| 欧美大尺度电影在线| 色哟哟欧美精品| 日本丰满少妇一区二区三区| 国产成a人亚洲精| 亚洲一区二区三区在线| 国产精品视频观看| 日本精品一区二区三区高清| 国产精品一区二区在线观看网站| 蓝色福利精品导航| 老司机精品视频线观看86| 亚洲福利国产精品| 国产精品成人免费在线| 国产成人精品影视| 欧美中文字幕一二三区视频| 久久一日本道色综合| 国产一区二区0| 91欧美一区二区| 欧美亚洲国产怡红院影院| 中文字幕一区视频| 精品av综合导航| 亚洲国产中文字幕| 老司机精品视频线观看86| 成人在线视频首页| 欧美大片在线观看| 欧美激情一区二区三区四区| 欧美国产欧美亚州国产日韩mv天天看完整| 久久久噜噜噜久久中文字幕色伊伊| 久久综合精品国产一区二区三区| xnxx国产精品| 亚洲男帅同性gay1069| 亚洲综合av网| 久久99精品国产麻豆不卡| 欧美主播一区二区三区| 91免费在线看| 国产精品久久久久久久久久久免费看 | 懂色中文一区二区在线播放| a4yy欧美一区二区三区| 欧美日韩国产影片| 国产成人丝袜美腿| 亚洲视频综合在线| 色丁香久综合在线久综合在线观看| 丝袜美腿亚洲综合| 日本一区二区三区在线观看| 欧美日韩不卡一区二区| 大尺度一区二区| 麻豆精品一区二区三区| 亚洲午夜久久久久久久久电影院| 国产欧美在线观看一区| 日韩欧美一级二级三级久久久| 99re8在线精品视频免费播放| 麻豆精品视频在线观看| 亚洲精品一二三| 中文字幕乱码亚洲精品一区| 精品粉嫩aⅴ一区二区三区四区| 在线观看欧美日本| 不卡一区二区在线| 国产一二精品视频| 精一区二区三区| 麻豆精品视频在线观看免费| 偷拍日韩校园综合在线| 性做久久久久久久久| 亚洲精品国产精华液| 国产精品久久久久9999吃药| 亚洲国产激情av| 国产日韩综合av| 久久精品日韩一区二区三区| 精品三级在线观看| 欧美mv日韩mv国产网站app| 91精品国产色综合久久不卡蜜臀| 欧美性一级生活| 欧美午夜精品久久久久久孕妇| 91久久国产综合久久| 色哟哟国产精品| 欧美日韩一区二区三区四区| 欧美三级蜜桃2在线观看| 欧美日韩你懂得| 欧美人成免费网站| 日韩欧美激情在线| www久久精品| 国产日韩欧美精品在线| 国产精品免费视频观看| 亚洲蜜桃精久久久久久久| 一区二区三区中文在线| 午夜成人在线视频| 日本女人一区二区三区| 国模套图日韩精品一区二区| 国产精品中文字幕日韩精品| 波多野结衣一区二区三区| 91在线观看免费视频| 欧美性欧美巨大黑白大战| 欧美色精品在线视频| 欧美一区二区三区在线观看| 欧美精品一区二区三区蜜臀| 中文字幕第一区综合| 一区二区免费看| 免费日韩伦理电影| 国产aⅴ精品一区二区三区色成熟| 成人午夜视频网站| 欧洲精品在线观看| 日韩欧美资源站| 国产精品视频你懂的| 伊人性伊人情综合网| 奇米精品一区二区三区在线观看一 | 一区二区三区在线看| 亚洲成人久久影院| 国产一区二区女| 91麻豆视频网站| 制服丝袜中文字幕一区| 国产亚洲一区二区三区| 亚洲一区二区欧美激情| 国产综合久久久久影院| 色综合久久66| 久久久久久一二三区| 一区二区三区不卡视频在线观看 | 亚洲人吸女人奶水| 青青草国产精品亚洲专区无| 成人h动漫精品一区二| 日韩三级.com| 亚洲精品福利视频网站| 国产麻豆精品久久一二三| 欧美综合视频在线观看| 国产亚洲精品中文字幕| 午夜亚洲国产au精品一区二区| 国产+成+人+亚洲欧洲自线| 欧美日韩国产综合草草| 国产精品久久久久久久久果冻传媒| 日韩精品成人一区二区三区 | 国产大片一区二区| 69成人精品免费视频| 中文字幕中文在线不卡住| 美脚の诱脚舐め脚责91| 色又黄又爽网站www久久| 久久久久久电影| 青青草原综合久久大伊人精品优势| 99视频精品全部免费在线| 2021中文字幕一区亚洲| 日本午夜一本久久久综合| 色婷婷av一区二区三区软件 | 亚洲综合色成人| 成人国产视频在线观看| 26uuu亚洲| 久久99国产精品麻豆| 91精品国产色综合久久不卡电影 | 国产精品欧美一区喷水| 精品中文字幕一区二区小辣椒| 欧美日韩国产一区| 一区二区三区国产豹纹内裤在线| 99久久99久久精品免费看蜜桃| 欧美激情一二三区| 国产一区二区看久久| 欧美v日韩v国产v| 丝袜美腿一区二区三区| 欧美美女黄视频| 亚洲成人自拍网| 欧美丝袜丝交足nylons图片| 国产精品成人网| va亚洲va日韩不卡在线观看| 国产精品婷婷午夜在线观看| 国产精品亚洲人在线观看| 久久先锋资源网| 国产精品一区二区三区网站| 国产亚洲欧美一区在线观看| 国精产品一区一区三区mba视频| 精品免费日韩av| 国产中文字幕精品| 国产欧美一区二区精品忘忧草| 国产精品一区二区在线观看网站 | 国产曰批免费观看久久久| 2欧美一区二区三区在线观看视频| 国内精品免费**视频| 久久精品亚洲乱码伦伦中文| 国产精品一区在线| 亚洲婷婷在线视频| 色综合久久久久久久久| 亚洲午夜激情av| 欧美一区二区三区男人的天堂| 蜜桃久久久久久久| 久久精品人人做| 97se亚洲国产综合自在线不卡| 一区二区三区日韩精品| 欧美日韩国产免费一区二区| 男男gaygay亚洲| 国产亚洲一区二区三区在线观看| 成人动漫精品一区二区| 一区二区在线电影| 91精品国产乱| 国产aⅴ精品一区二区三区色成熟| 国产精品情趣视频| 欧美日韩美少妇| 国产主播一区二区| 一区二区不卡在线视频 午夜欧美不卡在| 欧美午夜宅男影院| 久久99久久久久| |精品福利一区二区三区|