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

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

?? os_core.c

?? ucos2.86版本結合STM板極支持包
?? C
?? 第 1 頁 / 共 5 頁
字號:
                OS_TASK_SW();                          /* Perform a context switch                     */
            }
        }
    }
    OS_EXIT_CRITICAL();
}


/*
*********************************************************************************************************
*                              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_RESERVED) {                       /* ... 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.
**********

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精一区二区三区| 久久成人免费网| 国产精品一二三在| 欧美大片一区二区| 蜜桃视频免费观看一区| 欧美一区二区三区视频在线 | 亚洲女性喷水在线观看一区| 国产精品亚洲午夜一区二区三区 | 不卡的av在线| 最新欧美精品一区二区三区| 99久久伊人网影院| 亚洲三级免费电影| 欧美日韩成人激情| 久久精品国产一区二区三区免费看 | 一区二区三区四区视频精品免费| 欧美中文字幕一二三区视频| 在线精品观看国产| 午夜视频久久久久久| 日韩久久精品一区| 国产999精品久久| 亚洲欧美日韩成人高清在线一区| 色88888久久久久久影院野外| 五月天久久比比资源色| 欧美成人性战久久| 成人高清视频在线| 性感美女极品91精品| 精品99一区二区三区| 97久久人人超碰| 视频一区欧美日韩| 国产精品你懂的在线欣赏| 在线一区二区三区四区| 久久超碰97中文字幕| 亚洲欧美在线观看| 欧美一二三四区在线| 国产69精品久久久久毛片 | 久久先锋影音av| 99精品国产91久久久久久| 天堂影院一区二区| 国产精品视频九色porn| 欧美另类高清zo欧美| 国产mv日韩mv欧美| 亚洲成人激情社区| 欧美国产一区在线| 欧美日韩精品一区二区三区四区| 国产一区免费电影| 亚洲一区二区在线视频| 国产亚洲一区二区三区四区| 欧美日韩国产另类不卡| 高清不卡在线观看| 美女视频黄 久久| 一级女性全黄久久生活片免费| 精品国产百合女同互慰| 欧美在线不卡一区| 成人午夜碰碰视频| 裸体歌舞表演一区二区| 亚洲午夜一区二区| 国产精品看片你懂得| 日韩精品中文字幕在线不卡尤物| 91久久国产综合久久| 国产精品白丝jk白祙喷水网站| 日韩中文字幕91| 亚洲综合激情网| 亚洲日本欧美天堂| 欧美国产在线观看| 久久久精品影视| 日韩久久久精品| 欧美高清视频不卡网| 欧美在线色视频| va亚洲va日韩不卡在线观看| 精品在线播放午夜| 日本欧美韩国一区三区| 亚洲狠狠爱一区二区三区| 亚洲视频免费在线| 综合中文字幕亚洲| 国产精品的网站| 国产精品看片你懂得| 亚洲国产精品av| 欧美国产日本视频| 国产欧美在线观看一区| 久久品道一品道久久精品| 日韩欧美国产高清| 精品国内二区三区| 精品国产免费视频| 精品免费日韩av| 精品欧美一区二区三区精品久久| 日韩一区二区电影| 欧美一区二区三区电影| 日韩一级二级三级精品视频| 欧美一区二区播放| 欧美videos中文字幕| 精品国产乱码久久久久久久久 | 国产午夜久久久久| 久久久国产综合精品女国产盗摄| 久久精品无码一区二区三区| 国产亚洲一区字幕| 国产精品国产自产拍在线| 国产精品夫妻自拍| 一区二区三区四区不卡在线| 亚洲一区二区三区国产| 日韩综合小视频| 国产乱码精品一区二区三区五月婷| 韩国av一区二区三区在线观看| 国产一区二区0| 成人国产精品免费观看视频| 91农村精品一区二区在线| 在线一区二区三区四区五区| 欧美精品1区2区3区| 久久综合久久99| 国产精品传媒视频| 亚洲第一av色| 久久不见久久见中文字幕免费| 懂色中文一区二区在线播放| 成人av网站免费| 精品视频一区二区不卡| 精品国产自在久精品国产| 国产蜜臀97一区二区三区| 亚洲欧美国产毛片在线| 日韩av中文字幕一区二区三区| 国产一区二区三区综合| 91丨九色丨国产丨porny| 91精品国产综合久久久蜜臀粉嫩| 久久网这里都是精品| 亚洲欧美日韩系列| 久久99精品国产| 91女人视频在线观看| 久久综合久久久久88| 亚洲乱码中文字幕| 精品一区在线看| 日本久久电影网| 国产亚洲精品aa午夜观看| 亚洲一二三级电影| 国产在线播放一区| 欧美午夜精品一区| 久久久久久夜精品精品免费| 亚洲一区二区三区四区的| 国产老女人精品毛片久久| 91久久国产综合久久| 欧美国产一区二区在线观看| 亚洲mv在线观看| av网站免费线看精品| 精品美女在线观看| 亚洲国产三级在线| 丁香六月久久综合狠狠色| 91精品国产综合久久香蕉的特点| 最新中文字幕一区二区三区| 国产一区二区三区日韩| 欧美一区二区三区四区五区| 一区二区三区精密机械公司| 国产精品99久久久久久有的能看| 欧美一级视频精品观看| 亚洲精品高清在线| 成人h版在线观看| 精品福利一区二区三区| 日韩中文字幕av电影| 欧洲一区二区三区在线| 中文字幕在线免费不卡| 国产专区欧美精品| 日韩欧美色电影| 日韩精品乱码免费| 欧美色图片你懂的| 亚洲一二三四区| 9久草视频在线视频精品| 久久久精品人体av艺术| 老司机午夜精品| 色老综合老女人久久久| 亚洲天天做日日做天天谢日日欢| 国产成人a级片| 精品国产凹凸成av人网站| 激情综合网激情| 91麻豆精品久久久久蜜臀 | 91网站最新网址| 亚洲人成网站色在线观看| 视频一区二区三区入口| 欧美美女直播网站| 亚洲图片欧美视频| 91久久精品一区二区三区| 亚洲一区二区三区四区在线观看 | 91激情五月电影| 久久久天堂av| 国产尤物一区二区| 久久欧美一区二区| 国产真实乱偷精品视频免| 久久久精品黄色| 国内精品国产三级国产a久久| 2020国产精品自拍| 美女看a上一区| 91精品国产综合久久香蕉麻豆| 久久精品国产一区二区三 | 一级女性全黄久久生活片免费| 欧美日韩一区视频| 日韩av中文字幕一区二区三区| 欧美一区二区高清| 激情综合网最新| 国产欧美精品一区二区色综合朱莉| 国产精品一卡二卡| 26uuu国产一区二区三区| 国产精品2024| 亚洲精品亚洲人成人网| 欧洲精品一区二区三区在线观看| 亚洲国产精品久久人人爱|