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

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

?? os_core.c

?? 大家快來下載。這是目前最新管方版本了,Micrium-uCOS-II-V284.zip
?? C
?? 第 1 頁 / 共 5 頁
字號:

/*
*********************************************************************************************************
*                              FIND HIGHEST PRIORITY TASK READY TO RUN
*
* Description: This function is called by other uC/OS-II services to determine the highest priority task
*              that is ready to run.  The global variable 'OSPrioHighRdy' is changed accordingly.
*
* Arguments  : none
*
* Returns    : none
*
* Notes      : 1) This function is INTERNAL to uC/OS-II and your application should not call it.
*              2) Interrupts are assumed to be disabled when this function is called.
*********************************************************************************************************
*/

static  void  OS_SchedNew (void)
{
#if OS_LOWEST_PRIO <= 63                         /* See if we support up to 64 tasks                   */
    INT8U   y;


    y             = OSUnMapTbl[OSRdyGrp];
    OSPrioHighRdy = (INT8U)((y << 3) + OSUnMapTbl[OSRdyTbl[y]]);
#else                                            /* We support up to 256 tasks                         */
    INT8U   y;
    INT16U *ptbl;


    if ((OSRdyGrp & 0xFF) != 0) {
        y = OSUnMapTbl[OSRdyGrp & 0xFF];
    } else {
        y = OSUnMapTbl[(OSRdyGrp >> 8) & 0xFF] + 8;
    }
    ptbl = &OSRdyTbl[y];
    if ((*ptbl & 0xFF) != 0) {
        OSPrioHighRdy = (INT8U)((y << 4) + OSUnMapTbl[(*ptbl & 0xFF)]);
    } else {
        OSPrioHighRdy = (INT8U)((y << 4) + OSUnMapTbl[(*ptbl >> 8) & 0xFF] + 8);
    }
#endif
}

/*$PAGE*/
/*
*********************************************************************************************************
*                                        COPY AN ASCII STRING
*
* Description: This function is called by other uC/OS-II services to copy an ASCII string from a 'source'
*              string to a 'destination' string.
*
* Arguments  : pdest    is a pointer to the string that will be receiving the copy.  Note that there MUST
*                       be sufficient space in the destination storage area to receive this string.
*
*              psrc     is a pointer to the source string.  The source string MUST NOT be greater than
*                       254 characters.
*
* Returns    : The size of the string (excluding the NUL terminating character)
*
* Notes      : 1) This function is INTERNAL to uC/OS-II and your application should not call it.
*********************************************************************************************************
*/

#if (OS_EVENT_NAME_SIZE > 1) || (OS_FLAG_NAME_SIZE > 1) || (OS_MEM_NAME_SIZE > 1) || (OS_TASK_NAME_SIZE > 1) || (OS_TMR_CFG_NAME_SIZE > 1)
INT8U  OS_StrCopy (INT8U *pdest, INT8U *psrc)
{
    INT8U  len;


    len = 0;
    while (*psrc != OS_ASCII_NUL) {
        *pdest++ = *psrc++;
        len++;
    }
    *pdest = OS_ASCII_NUL;
    return (len);
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                DETERMINE THE LENGTH OF AN ASCII STRING
*
* Description: This function is called by other uC/OS-II services to determine the size of an ASCII string
*              (excluding the NUL character).
*
* Arguments  : psrc     is a pointer to the string for which we need to know the size.
*
* Returns    : The size of the string (excluding the NUL terminating character)
*
* Notes      : 1) This function is INTERNAL to uC/OS-II and your application should not call it.
*              2) The string to check must be less than 255 characters long.
*********************************************************************************************************
*/

#if (OS_EVENT_NAME_SIZE > 1) || (OS_FLAG_NAME_SIZE > 1) || (OS_MEM_NAME_SIZE > 1) || (OS_TASK_NAME_SIZE > 1) || (OS_TMR_CFG_NAME_SIZE > 1)
INT8U  OS_StrLen (INT8U *psrc)
{
    INT8U  len;


    len = 0;
    while (*psrc != OS_ASCII_NUL) {
        psrc++;
        len++;
    }
    return (len);
}
#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 ALL waiting for event(s) to occur.
*
* Arguments  : none
*
* Returns    : none
*
* Note(s)    : 1) OSTaskIdleHook() is called after the critical section to ensure that interrupts will be
*                 enabled for at least a few instructions.  On some processors (ex. Philips XA), enabling
*                 and then disabling interrupts didn't allow the processor enough time to have interrupts
*                 enabled before they were disabled again.  uC/OS-II would thus never recognize
*                 interrupts.
*              2) This hook has been added to allow you to do such things as STOP the CPU to conserve
*                 power.
*********************************************************************************************************
*/

void  OS_TaskIdle (void *p_arg)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#endif



    (void)p_arg;                                 /* Prevent compiler warning for not using 'parg'      */
    for (;;) {
        OS_ENTER_CRITICAL();
        OSIdleCtr++;
        OS_EXIT_CRITICAL();
        OSTaskIdleHook();                        /* Call user definable HOOK                           */
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                            STATISTICS TASK
*
* Description: This task is internal to uC/OS-II and is used to compute some statistics about the
*              multitasking environment.  Specifically, OS_TaskStat() computes the CPU usage.
*              CPU usage is determined by:
*
*                                          OSIdleCtr
*                 OSCPUUsage = 100 * (1 - ------------)     (units are in %)
*                                         OSIdleCtrMax
*
* Arguments  : parg     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_TASK_IDLE_PRIO-1.
*              2) You can disable this task by setting the configuration #define OS_TASK_STAT_EN to 0.
*              3) You MUST have at least a delay of 2/10 seconds to allow for the system to establish the
*                 maximum value for the idle counter.
*********************************************************************************************************
*/

#if OS_TASK_STAT_EN > 0
void  OS_TaskStat (void *p_arg)
{
    INT32U     run;
    INT32U     max;
    INT8S      usage;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#endif



    p_arg = p_arg;                               /* Prevent compiler warning for not using 'parg'      */
    while (OSStatRdy == OS_FALSE) {
        OSTimeDly(2 * OS_TICKS_PER_SEC / 10);    /* Wait until statistic task is ready                 */
    }
    max = OSIdleCtrMax / 100L;
    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 (max > 0L) {
            usage = (INT8S)(100L - run / max);
            if (usage >= 0) {                    /* Make sure we don't have a negative percentage      */
                OSCPUUsage = usage;
            } else {
                OSCPUUsage = 0;
            }
        } else {
            OSCPUUsage = 0;
            max        = OSIdleCtrMax / 100L;
        }
        OSTaskStatHook();                        /* Invoke user definable hook                         */
#if (OS_TASK_STAT_STK_CHK_EN > 0) && (OS_TASK_CREATE_EXT_EN > 0)
        OS_TaskStatStkChk();                     /* Check the stacks for each task                     */
#endif
        OSTimeDly(OS_TICKS_PER_SEC / 10);        /* Accumulate OSIdleCtr for the next 1/10 second      */
    }
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                      CHECK ALL TASK STACKS
*
* Description: This function is called by OS_TaskStat() to check the stacks of each active task.
*
* Arguments  : none
*
* Returns    : none
*********************************************************************************************************
*/

#if (OS_TASK_STAT_STK_CHK_EN > 0) && (OS_TASK_CREATE_EXT_EN > 0)
void  OS_TaskStatStkChk (void)
{
    OS_TCB      *ptcb;
    OS_STK_DATA  stk_data;
    INT8U        err;
    INT8U        prio;


    for (prio = 0; prio <= OS_TASK_IDLE_PRIO; prio++) {
        err = OSTaskStkChk(prio, &stk_data);
        if (err == OS_ERR_NONE) {
            ptcb = OSTCBPrioTbl[prio];
            if (ptcb != (OS_TCB *)0) {                               /* Make sure task 'ptcb' is ...   */
                if (ptcb != (OS_TCB *)1) {                           /* ... still valid.               */
#if OS_TASK_PROFILE_EN > 0
                    #if OS_STK_GROWTH == 1
                    ptcb->OSTCBStkBase = ptcb->OSTCBStkBottom + ptcb->OSTCBStkSize;
                    #else
                    ptcb->OSTCBStkBase = ptcb->OSTCBStkBottom - ptcb->OSTCBStkSize;
                    #endif
                    ptcb->OSTCBStkUsed = stk_data.OSUsed;            /* Store the number of bytes used */
#endif
                }
            }
        }
    }
}
#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_ERR_NONE         if the call was successful
*              OS_ERR_TASK_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  OS_TCBInit (INT8U prio, OS_STK *ptos, OS_STK *pbos, INT16U id, INT32U stk_size, void *pext, INT16U opt)
{
    OS_TCB    *ptcb;
#if OS_CRITICAL_METHOD == 3                                /* All

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99精品视频一区二区| 色欧美片视频在线观看| 日韩欧美成人午夜| 久久99国产精品久久99| 欧美国产日韩精品免费观看| 91色九色蝌蚪| 久久不见久久见免费视频7| 亚洲人成在线观看一区二区| 欧美一级二级三级蜜桃| 国内精品国产三级国产a久久| 欧美高清一级片在线观看| 欧美日韩一区二区三区高清| 国产精品亚洲专一区二区三区 | 欧美不卡在线视频| 高清国产一区二区| 国产精品原创巨作av| 麻豆91免费观看| 天天亚洲美女在线视频| 亚洲最新视频在线观看| 国产精品久久综合| 国产亚洲女人久久久久毛片| 91精品中文字幕一区二区三区| 色狠狠色狠狠综合| 一本大道久久a久久精二百| 成人免费观看av| 成人做爰69片免费看网站| 成人中文字幕合集| 91丨九色丨尤物| 精品精品国产高清a毛片牛牛 | www.日本不卡| 99国产精品久久久久久久久久| 成人免费视频caoporn| 国产成人免费在线视频| k8久久久一区二区三区| 91麻豆视频网站| 91麻豆精品国产91久久久| 日韩女优视频免费观看| 亚洲影院在线观看| 极品少妇一区二区三区精品视频 | 在线成人免费视频| 久久久青草青青国产亚洲免观| 国产视频一区二区在线观看| 一区二区三区四区激情| 福利视频网站一区二区三区| 欧美影院午夜播放| 精品福利一二区| 一区二区三区四区av| 国产成人综合亚洲91猫咪| 在线观看网站黄不卡| 精品电影一区二区三区| 亚洲永久免费av| 懂色一区二区三区免费观看| 欧美系列日韩一区| 中文字幕一区免费在线观看| 久久国产生活片100| 欧美性一区二区| 久久天堂av综合合色蜜桃网| 亚洲成a人在线观看| 99re热视频精品| 欧美激情中文不卡| 麻豆一区二区三区| 久久综合九色综合欧美就去吻| 亚洲一区二区三区在线播放| 99精品视频在线免费观看| 久久久影视传媒| 精品一区二区三区在线观看国产| 欧美精品 国产精品| 久久国产精品一区二区| 久久亚洲捆绑美女| 国产精品主播直播| 国产精品欧美一区喷水| 欧美在线|欧美| 日本午夜一本久久久综合| 日韩精品在线一区| 精品在线一区二区| 国产精品电影院| 欧美性大战久久久久久久蜜臀| 亚洲人一二三区| 欧美一三区三区四区免费在线看| 午夜在线成人av| 亚洲最新视频在线播放| 9191久久久久久久久久久| 国产黄色成人av| 亚洲欧美精品午睡沙发| 69堂国产成人免费视频| 国产激情视频一区二区三区欧美| 中文字幕日本不卡| 久久人人97超碰com| 色视频欧美一区二区三区| 轻轻草成人在线| 一区二区三区.www| 国产婷婷色一区二区三区| 欧美午夜在线观看| av亚洲产国偷v产偷v自拍| 日韩国产欧美在线视频| 中文字幕第一区第二区| 久久久九九九九| 精品美女一区二区三区| 91精品久久久久久蜜臀| 欧美色欧美亚洲另类二区| 欧美日韩情趣电影| 99国产精品久| 粉嫩高潮美女一区二区三区| 精品一区二区三区香蕉蜜桃| 亚洲伦理在线免费看| 国产农村妇女精品| 精品成人在线观看| 欧美大片日本大片免费观看| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 国模少妇一区二区三区| 裸体在线国模精品偷拍| 热久久久久久久| 狠狠色狠狠色综合系列| 国产成人8x视频一区二区 | 国产一区二区美女| 国内精品嫩模私拍在线| 国产九九视频一区二区三区| 国产99久久久国产精品免费看| 丰满少妇久久久久久久| 99久久久国产精品| 91国偷自产一区二区开放时间| 欧美丝袜丝nylons| 久久精品亚洲乱码伦伦中文| 国产精品你懂的| 国产精品一卡二卡在线观看| 国产成a人亚洲精| 欧美日韩一区在线观看| 久久综合九色综合久久久精品综合| 欧美激情一区二区三区蜜桃视频| 亚洲黄网站在线观看| 久久不见久久见免费视频7| 成人福利视频在线| 日韩一区二区三区电影在线观看 | 亚洲麻豆国产自偷在线| 久久av资源网| 777奇米成人网| 亚洲制服欧美中文字幕中文字幕| 91福利视频在线| 欧美一个色资源| 亚洲一区二区在线免费观看视频| 成人免费不卡视频| 精品福利av导航| 美女视频网站久久| 91麻豆精品国产91久久久使用方法| 中文字幕一区二区三区色视频| 国产经典欧美精品| 欧美成人女星排行榜| 免费日韩伦理电影| 7777精品久久久大香线蕉| 亚洲成人在线免费| 欧美日韩电影一区| 亚洲一区二区av在线| 欧美在线啊v一区| 亚洲国产精品精华液网站| 欧美午夜视频网站| 五月婷婷久久丁香| 亚洲精品精品亚洲| 91搞黄在线观看| 国产在线视频精品一区| 国产精品免费丝袜| 91精品办公室少妇高潮对白| 艳妇臀荡乳欲伦亚洲一区| 欧美人伦禁忌dvd放荡欲情| 麻豆精品视频在线观看免费| 久久精品视频一区二区| 成人综合在线视频| 日韩综合小视频| 久久九九99视频| 91精品福利视频| 黄色成人免费在线| 亚洲综合在线五月| 欧美岛国在线观看| 91成人在线观看喷潮| 极品销魂美女一区二区三区| 亚洲丝袜另类动漫二区| 精品国产一区a| 欧美色电影在线| 成人免费高清在线观看| 激情亚洲综合在线| 日韩电影在线免费看| 亚洲人被黑人高潮完整版| 亚洲一区视频在线| 国产欧美一区二区在线观看| 91精品午夜视频| 欧美午夜理伦三级在线观看| 91免费观看视频在线| 国产白丝精品91爽爽久久| 久久se这里有精品| 乱中年女人伦av一区二区| 亚洲国产日韩精品| 午夜视频久久久久久| 亚洲一区二区三区爽爽爽爽爽| 亚洲欧洲一区二区在线播放| 中文字幕第一区二区| 国产精品嫩草影院com| 亚洲精品免费一二三区| 亚洲高清久久久| 日韩在线一区二区| 精品无码三级在线观看视频| 国产精品影视在线观看|