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

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

?? os_core.c

?? c8051f020單片機的例程
?? C
?? 第 1 頁 / 共 3 頁
字號:
*                 CPU Usage (%) = 100 * (1 - ------------)
*                                            OSIdleCtrMax
*
* Arguments  : none
*
* 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 *ppdata) reentrant
{
    ppdata = ppdata;                               /* Prevent compiler warning for not using 'pdata'     */
    for (;;) {
        OS_ENTER_CRITICAL();
        OSIdleCtr++;
        OS_EXIT_CRITICAL();
    }
}
/*$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  : pdata     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 *ppdata) reentrant
{
    INT32U run;
    INT8S  usage;
    
    
    ppdata = ppdata;                               /* Prevent compiler warning for not using 'pdata'     */
    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.
*********************************************************************************************************
*/

INT8U OSTCBInit (INT8U prio, OS_STK *ptos, OS_STK *pbos, INT16U id, INT16U stk_size, void *pext, INT16U opt) reentrant
{
    OS_TCB *ptcb;


    OS_ENTER_CRITICAL();
    ptcb = OSTCBFreeList;                                  /* Get a free TCB from the free TCB list    */
    if (ptcb != (OS_TCB *)0) {
        OSTCBFreeList        = ptcb->OSTCBNext;            /* Update pointer to free TCB list          */
        OS_EXIT_CRITICAL();
        ptcb->OSTCBStkPtr    = ptos;                       /* Load Stack pointer in TCB                */
        ptcb->OSTCBPrio      = (INT8U)prio;                /* Load task priority into TCB              */
        ptcb->OSTCBStat      = OS_STAT_RDY;                /* Task is ready to run                     */
        ptcb->OSTCBDly       = 0;                          /* Task is not delayed                      */

#if OS_TASK_CREATE_EXT_EN        
        ptcb->OSTCBExtPtr    = pext;                       /* Store pointer to TCB extension           */
        ptcb->OSTCBStkSize   = stk_size;                   /* Store stack size                         */
        ptcb->OSTCBStkBottom = pbos;                       /* Store pointer to bottom of stack         */
        ptcb->OSTCBOpt       = opt;                        /* Store task options                       */
        ptcb->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        
        ptcb->OSTCBDelReq    = OS_NO_ERR;
#endif

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

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

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

        OS_ENTER_CRITICAL();
        OSTCBPrioTbl[prio]   = ptcb;
        ptcb->OSTCBNext      = OSTCBList;                  /* Link into TCB chain                      */
        ptcb->OSTCBPrev      = (OS_TCB *)0;
        if (OSTCBList != (OS_TCB *)0) {
            OSTCBList->OSTCBPrev = ptcb;
        }
        OSTCBList               = ptcb;
        OSRdyGrp               |= ptcb->OSTCBBitY;         /* Make task ready to run                   */
        OSRdyTbl[ptcb->OSTCBY] |= ptcb->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) reentrant
{
    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.
*********************************************************************************************************
*/

INT16U OSVersion (void) reentrant
{
    return (OS_VERSION);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产精品ⅴa在线观看| 蜜臀a∨国产成人精品| 国产精品二区一区二区aⅴ污介绍| 精品91自产拍在线观看一区| 欧美一二区视频| 欧美成人午夜电影| 精品区一区二区| 久久久激情视频| 中文字幕免费一区| 中文字幕一区二区三区色视频| 中文字幕一区在线观看视频| 日韩毛片精品高清免费| 一区二区三区国产豹纹内裤在线| 亚洲天堂网中文字| 亚洲综合色丁香婷婷六月图片| 一区二区三区四区不卡在线| 亚洲一区免费视频| 青青青伊人色综合久久| 国产曰批免费观看久久久| 国产精品一区在线| av一区二区三区| 欧美在线免费视屏| 欧美一级日韩不卡播放免费| 精品少妇一区二区| 国产精品久久久久久户外露出| 亚洲精品五月天| 日本不卡在线视频| 高清免费成人av| 欧美性一二三区| 精品国产一区二区三区四区四| 欧美国产日本韩| 一区二区不卡在线播放 | 一区二区三国产精华液| 五月天亚洲精品| 极品少妇xxxx精品少妇| 成人免费视频视频| 欧美人牲a欧美精品| 久久综合色婷婷| 亚洲人成影院在线观看| 日韩和的一区二区| 国产1区2区3区精品美女| 欧美影视一区在线| 日韩三级精品电影久久久 | 波多野结衣一区二区三区 | 中文字幕免费不卡| 日韩一区精品视频| 国产成人av一区二区| 91精品办公室少妇高潮对白| 日韩免费性生活视频播放| 亚洲三级电影全部在线观看高清| 日韩激情视频在线观看| 成人免费黄色大片| 欧美一区二区三区在| 亚洲视频在线观看三级| 麻豆专区一区二区三区四区五区| 99久久综合99久久综合网站| 91精品欧美久久久久久动漫| 日本一区免费视频| 美国三级日本三级久久99| 91猫先生在线| 26uuu久久天堂性欧美| 亚洲国产成人91porn| 床上的激情91.| 欧美白人最猛性xxxxx69交| 一区二区三区.www| 成人高清在线视频| 精品国产制服丝袜高跟| 日韩精品色哟哟| 色综合一区二区三区| 中文字幕av不卡| 精品亚洲aⅴ乱码一区二区三区| 欧美色区777第一页| 中文字幕字幕中文在线中不卡视频| 精品午夜一区二区三区在线观看| 欧美乱妇20p| 夜夜精品浪潮av一区二区三区| 成人性视频免费网站| 精品国产99国产精品| 蜜臀a∨国产成人精品| 欧美日韩高清一区二区不卡| 成人欧美一区二区三区| 成人av资源在线| 日本一区二区免费在线| 国产美女精品一区二区三区| 日韩免费电影一区| 日本成人在线视频网站| 在线不卡欧美精品一区二区三区| 亚洲精品久久嫩草网站秘色| 99在线精品观看| 中文字幕一区二区三区色视频| 国产.欧美.日韩| 国产精品美日韩| av不卡在线观看| 亚洲欧美日韩小说| 色婷婷久久99综合精品jk白丝| 亚洲欧美另类小说| 日本精品免费观看高清观看| 亚洲日本丝袜连裤袜办公室| 99久久精品99国产精品| 国产精品国产自产拍高清av王其| 成人av在线播放网址| 中文字幕一区二区三区蜜月| 99精品欧美一区| 一区二区三区 在线观看视频| 色综合激情五月| 亚洲一区二区三区四区在线免费观看 | 国产精品三级视频| 福利一区二区在线观看| 国产精品毛片久久久久久| 成人视屏免费看| 成人免费在线视频| 欧美在线色视频| 青青青爽久久午夜综合久久午夜 | 亚洲欧洲另类国产综合| 91免费小视频| 亚洲国产欧美一区二区三区丁香婷| 欧美亚洲国产一卡| 热久久国产精品| 久久久噜噜噜久噜久久综合| 成人国产视频在线观看| 亚洲精品成a人| 欧美精品aⅴ在线视频| 麻豆精品新av中文字幕| 久久综合九色综合97婷婷女人 | 老司机一区二区| 国产视频911| 99久久er热在这里只有精品15| 悠悠色在线精品| 91精品国产高清一区二区三区| 麻豆一区二区三区| 国产精品久久久久久久久快鸭 | 91福利视频在线| 亚洲mv在线观看| 精品sm捆绑视频| 99久久婷婷国产精品综合| 亚洲国产日韩综合久久精品| 日韩精品91亚洲二区在线观看| 免费人成在线不卡| 国产成人av一区二区三区在线观看| 成人av综合一区| 欧美日韩一级二级| 久久久国产精华| 亚洲国产一区二区三区| 另类小说视频一区二区| av男人天堂一区| 制服.丝袜.亚洲.另类.中文| 久久久电影一区二区三区| 亚洲精品日韩综合观看成人91| 日韩精品午夜视频| 99久久亚洲一区二区三区青草| 欧美日韩一区不卡| 国产日韩欧美高清在线| 婷婷成人激情在线网| 国产精品18久久久| 欧美人牲a欧美精品| 中文字幕精品三区| 青青青爽久久午夜综合久久午夜| 不卡的电影网站| 日韩一区二区在线看片| 中文字幕在线观看一区| 激情图区综合网| 欧美色手机在线观看| 国产精品天干天干在线综合| 日韩电影免费在线| 91小视频免费看| 国产欧美一区二区精品婷婷 | 欧美美女黄视频| 亚洲男人电影天堂| 成人一级黄色片| 91精品国产免费| 亚洲第一搞黄网站| 色成人在线视频| 亚洲国产成人一区二区三区| 久久99热99| 欧美精品日韩精品| 亚洲一区二三区| 不卡大黄网站免费看| 日韩精品中文字幕一区二区三区| 亚洲不卡在线观看| 欧美在线你懂得| 亚洲精品乱码久久久久久久久| 成人污污视频在线观看| 国产色产综合色产在线视频| 久久不见久久见免费视频1| 欧美卡1卡2卡| 午夜精品一区二区三区电影天堂| 91蝌蚪porny| 亚洲欧美视频在线观看| 99re6这里只有精品视频在线观看| 国产日产欧美一区二区视频| 国产一区不卡在线| 久久蜜桃av一区精品变态类天堂| 精品一区二区三区视频在线观看| 日韩一区二区三免费高清| 日韩在线一区二区三区| 91麻豆精品国产91| 麻豆精品精品国产自在97香蕉| 日韩三级在线观看| 狠狠狠色丁香婷婷综合久久五月| 久久午夜老司机|