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

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

?? os_core.c

?? ucosII在TMS320LF2407成功移植的源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
*********************************************************************************************************
*                                              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 *pdata)
{
    pdata = pdata;                               /* 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 *pdata)
{
    INT32U run;
    INT8S  usage;
    
    
    pdata = pdata;                               /* 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         */
        asm("        .bss	CONST,1,1");
    	asm("        LDP	#10CH");
        asm("        SPLK	#0FFFH,CONST");
        asm("        OUT	CONST,0000H");
        asm("        OUT	CONST,0004H");
        asm("        RPT	#255");
        asm("        NOP");
        asm("        RPT	#255");
        asm("        NOP");
        asm("        RPT	#255");
        asm("        NOP");
        asm("        RPT	#255");
        asm("        NOP");
        asm("        RPT	#255");
        asm("        NOP");
        asm("        RPT	#255");
        asm("        NOP");
        asm("        RPT	#255");
        asm("        NOP");
        asm("        RPT	#255");
        asm("        NOP");
        asm("        RPT	#255");
        asm("        NOP");
        asm("        RPT	#255");
        asm("        NOP");
        asm("        RPT	#255");
        asm("        NOP");
        asm("        RPT	#255");
        asm("        NOP");
        asm("        RPT	#255");
        asm("        NOP");
        asm("        RPT	#255");
        asm("        NOP");
        asm("        SPLK	#0H,CONST");
        asm("        OUT	CONST,0000H");
        asm("        OUT	CONST,0004H");
        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)
{
    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)
{
    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)
{
    return (OS_VERSION);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩久久一区二区| 亚洲一区二区三区四区在线观看 | 亚洲成av人片在www色猫咪| 国产精品免费网站在线观看| 久久天天做天天爱综合色| 精品国产麻豆免费人成网站| 欧美一区二区在线视频| 欧美剧情片在线观看| 91精品国产一区二区三区蜜臀| 欧美精选一区二区| 日韩一区二区不卡| 精品日产卡一卡二卡麻豆| 精品国产一区二区三区忘忧草| 久久综合丝袜日本网| 久久精品亚洲乱码伦伦中文| 久久蜜桃av一区二区天堂| 国产女主播视频一区二区| 国产精品久久久久久久午夜片| 日韩美女视频一区| 奇米影视一区二区三区| 亚洲成人动漫在线免费观看| 日韩制服丝袜av| 欧美a级理论片| 国精品**一区二区三区在线蜜桃| 国产真实乱对白精彩久久| 国产91精品入口| av网站免费线看精品| 色狠狠色噜噜噜综合网| 欧美人与禽zozo性伦| 精品欧美一区二区久久| 亚洲国产精品99久久久久久久久 | 国产在线不卡一区| 不卡视频在线观看| 欧美日韩国产大片| 26uuu久久天堂性欧美| 国产精品理伦片| 亚洲大片免费看| 国内精品在线播放| 91丨九色丨蝌蚪丨老版| 67194成人在线观看| 久久久久国产精品人| 亚洲精品国产精品乱码不99| 日本午夜精品视频在线观看 | 91国偷自产一区二区三区成为亚洲经典| 91行情网站电视在线观看高清版| 6080亚洲精品一区二区| 国产欧美一区二区三区鸳鸯浴| 亚洲精品国久久99热| 美女视频免费一区| 99久久精品免费看| 日韩免费高清视频| 亚洲免费观看在线视频| 麻豆91在线播放| 91蝌蚪porny| 亚洲精品在线观看网站| 亚洲综合成人在线视频| 国产一区二区在线视频| 精品视频在线免费看| 国产亚洲精品bt天堂精选| 香蕉成人啪国产精品视频综合网| 国产成人一级电影| 欧美一区二区在线视频| 一区二区三区日韩欧美精品| 国产一区二区中文字幕| 在线播放中文字幕一区| 综合在线观看色| 国产酒店精品激情| 欧美一级在线视频| 亚洲综合丁香婷婷六月香| 成人一区二区在线观看| 欧美电影免费观看高清完整版 | 成人av在线一区二区| 欧美美女一区二区| 亚洲人成7777| 成人亚洲一区二区一| 日韩亚洲欧美一区| 亚洲午夜久久久久久久久电影院| 粉嫩蜜臀av国产精品网站| 日韩视频在线一区二区| 五月天亚洲婷婷| 色综合久久久久综合99| 国产欧美精品一区二区三区四区| 美女诱惑一区二区| 欧美日精品一区视频| 亚洲欧美综合另类在线卡通| 国产久卡久卡久卡久卡视频精品| 日韩免费看网站| 亚洲va中文字幕| 色婷婷av一区二区三区大白胸| 久久久久久久久99精品| 精品在线免费观看| 日韩一区二区三区在线视频| 亚洲第一电影网| 91成人国产精品| 一区二区三区免费| 日本韩国欧美在线| 亚洲日穴在线视频| 99精品久久只有精品| 欧美国产激情一区二区三区蜜月| 国产一区二区三区精品视频 | 五月天激情小说综合| 91国产精品成人| 一区二区三区在线视频观看| 91网站在线播放| 综合久久久久久久| 91美女在线观看| 亚洲欧美日韩在线| 色综合久久中文综合久久97| 亚洲婷婷国产精品电影人久久| 91玉足脚交白嫩脚丫在线播放| 国产精品婷婷午夜在线观看| 成人亚洲一区二区一| 一区在线观看视频| 色网综合在线观看| 亚瑟在线精品视频| 日韩一区二区三区四区| 久久国产精品一区二区| 久久久www免费人成精品| 国产黄色91视频| 国产精品久久久久精k8| 一本一道波多野结衣一区二区| 亚洲精品一二三| 欧美群妇大交群中文字幕| 日本视频免费一区| 久久色在线视频| 波多野结衣在线一区| 一区二区三区中文字幕| 欧美一区二区三区的| 国产一区在线观看视频| 国产精品国产三级国产普通话蜜臀| 欧美在线免费播放| 免费观看成人av| 欧美激情在线一区二区| 91碰在线视频| 日本va欧美va精品| 中文字幕不卡在线观看| 在线看不卡av| 久久99精品久久久久婷婷| 欧美国产一区在线| 欧美日韩在线播放一区| 精品综合久久久久久8888| 国产精品理论在线观看| 91精品国产综合久久国产大片| 国产毛片精品国产一区二区三区| 亚洲天堂免费看| 欧美成人免费网站| 91视频国产资源| 日本vs亚洲vs韩国一区三区| 国产精品无人区| 欧美丰满一区二区免费视频| 国产福利一区二区| 亚洲成人免费在线| 国产欧美一区二区精品婷婷 | 欧美国产激情二区三区| 欧美日韩亚洲国产综合| 国产美女娇喘av呻吟久久| 亚洲精品欧美综合四区| 久久久久久久久伊人| 在线观看日韩精品| 国产成人精品午夜视频免费| 一区二区激情小说| 国产欧美日韩精品在线| 欧美日韩大陆一区二区| eeuss鲁片一区二区三区| 日韩黄色在线观看| 一区二区在线观看av| 久久婷婷成人综合色| 欧美日韩激情一区二区| 懂色av一区二区夜夜嗨| 天涯成人国产亚洲精品一区av| 国产精品久久久久久久久快鸭 | 亚洲成人激情社区| 欧美国产一区视频在线观看| 日韩一区二区三区在线| 在线视频一区二区三| 处破女av一区二区| 麻豆freexxxx性91精品| 天堂资源在线中文精品| 亚洲欧美在线另类| 久久久久久久久久久久久女国产乱| 欧美日韩精品免费观看视频 | 国产精品入口麻豆九色| 欧美一卡二卡在线观看| 欧美精品一卡两卡| 91蜜桃网址入口| 成人丝袜视频网| 国产在线观看免费一区| 欧美96一区二区免费视频| 亚洲黄一区二区三区| 中文字幕一区二区三区不卡在线| 精品美女一区二区三区| 欧美一区二区三区在| 欧美在线综合视频| 色爱区综合激月婷婷| a在线欧美一区| 欧美日本一区二区三区四区| 99久免费精品视频在线观看 | 久久久久亚洲蜜桃| 欧美成人三级在线| 日韩美女天天操|