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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? os_core.c

?? uc/os原代碼
?? C
?? 第 1 頁 / 共 5 頁
字號:
#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)
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)
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_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 == 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_IDLE_PRIO; prio++) {
        err = OSTaskStkChk(prio, &stk_data);
        if (err == OS_NO_ERR) {
            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_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  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                                /* Allocate storage for CPU status register */
    OS_CPU_SR  cpu_sr = 0;
#endif



    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      = prio;                       /* Load task priority into TCB              */
        ptcb->OSTCBStat      = OS_STAT_RDY;                /* Task is ready to run                     */
        ptcb->OSTCBPendTO    = FALSE;                      /* Clear the Pend timeout flag              */
        ptcb->OSTCBDly       = 0;                          /* Task is not delayed                      */

#if OS_TASK_CREATE_EXT_EN > 0
        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 n

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产嫩草影院久久久久| 中文字幕一区二区5566日韩| 国产成人免费av在线| 一区二区在线观看不卡| 2021中文字幕一区亚洲| 欧美三级韩国三级日本三斤| 成人一级视频在线观看| 日日摸夜夜添夜夜添国产精品| 国产三级一区二区| 日韩免费观看2025年上映的电影| 91一区二区在线| 韩国女主播成人在线观看| 亚洲成人综合网站| 国产精品乱子久久久久| 日韩欧美一区二区久久婷婷| 色婷婷一区二区| 国产福利视频一区二区三区| 丝袜美腿亚洲一区| 亚洲狠狠爱一区二区三区| 国产精品久久久久久久久动漫| 日韩精品一区二区三区视频播放| 欧美午夜一区二区三区| 99久久99久久精品免费看蜜桃| 黑人巨大精品欧美一区| 婷婷久久综合九色国产成人 | 欧美一区二区私人影院日本| 91在线国产观看| 成人午夜视频在线| 国内精品伊人久久久久影院对白| 日欧美一区二区| 亚洲自拍偷拍麻豆| 一区二区三区四区在线| 国产精品久久久久久妇女6080| 精品奇米国产一区二区三区| 91精品国产综合久久精品app | 高清beeg欧美| 国产成人亚洲精品青草天美| 国产一区二区三区高清播放| 国产伦精品一区二区三区免费| 九九精品视频在线看| 视频在线观看91| 日韩高清中文字幕一区| 免费在线欧美视频| 美腿丝袜亚洲一区| 久久精品国内一区二区三区| 久久精品国产在热久久| 国产一区二区在线观看视频| 精品一区二区三区视频在线观看| 精品一区二区三区视频在线观看| 国产一区二区三区日韩| 极品少妇xxxx精品少妇偷拍| 国产一区在线不卡| 国产成人一区在线| 91在线播放网址| 91高清在线观看| 欧美男同性恋视频网站| 日韩午夜在线观看视频| 久久综合国产精品| 国产婷婷精品av在线| 亚洲欧美在线高清| 亚洲在线成人精品| 蜜臀av在线播放一区二区三区 | eeuss鲁片一区二区三区在线看 | 久久久久久久久久久黄色| 国产三级三级三级精品8ⅰ区| 国产精品美女久久久久久久久久久| 中文字幕中文字幕一区| 亚洲中国最大av网站| 男男视频亚洲欧美| 福利电影一区二区三区| 色94色欧美sute亚洲线路一久| 欧美日韩午夜精品| 亚洲精品在线观| 亚洲少妇最新在线视频| 日本欧美韩国一区三区| 国产成人精品亚洲午夜麻豆| 91免费视频网址| 91精品国产综合久久婷婷香蕉 | 免费成人小视频| 国产一区二区三区综合| 91麻豆自制传媒国产之光| 3d成人h动漫网站入口| 久久精品亚洲麻豆av一区二区| 国产精品久久毛片| 日韩精品亚洲一区| 成人综合婷婷国产精品久久 | 亚洲成人av福利| 国产在线视视频有精品| 色又黄又爽网站www久久| 日韩欧美国产午夜精品| 亚洲三级在线播放| 国模冰冰炮一区二区| 欧美中文字幕久久| 国产欧美一区在线| 日韩国产精品久久| 99久久婷婷国产精品综合| 日韩欧美中文字幕一区| 一区二区免费视频| 国产成人免费视频网站高清观看视频| 欧美日韩亚洲丝袜制服| 中文字幕欧美一区| 国产一区二区在线看| 91精品麻豆日日躁夜夜躁| 亚洲精品免费看| 国产91色综合久久免费分享| 91精品久久久久久久99蜜桃| 一区二区三区四区高清精品免费观看| 国产精品中文欧美| 欧美一二三区精品| 亚洲一二三区在线观看| 不卡的av在线| 国产亚洲午夜高清国产拍精品 | 国产乱国产乱300精品| 欧美日韩一区二区三区高清| 综合久久给合久久狠狠狠97色| 精品一区二区三区在线观看| 91 com成人网| 亚洲国产成人av网| 在线亚洲欧美专区二区| 中文字幕亚洲不卡| 成人小视频免费观看| 国产亚洲精久久久久久| 国产精品资源网站| 久久免费国产精品| 精品一区二区三区久久| 日韩精品专区在线| 日韩电影免费在线| 欧美日韩免费观看一区二区三区 | 国产成人精品网址| 久久久久久久久99精品| 国产一区不卡视频| 久久蜜桃av一区精品变态类天堂| 国内久久精品视频| 久久婷婷色综合| 国产乱码精品一区二区三| 久久一日本道色综合| 国产精品996| 国产亚洲女人久久久久毛片| 国产98色在线|日韩| 国产精品女主播av| 成人高清伦理免费影院在线观看| 国产片一区二区| av高清不卡在线| 亚洲最新视频在线播放| 欧美日产国产精品| 青青草国产精品97视觉盛宴| 亚洲精品一线二线三线| 国产一区不卡在线| 中文字幕中文乱码欧美一区二区| 91在线高清观看| 亚洲午夜久久久久| 日韩免费高清av| 国产成人aaa| 亚洲老妇xxxxxx| 欧美久久一二三四区| 青青草97国产精品免费观看| 久久欧美中文字幕| 成人18精品视频| 亚洲国产日韩精品| 日韩一区二区三区视频| 久久99国产精品尤物| 欧美国产精品劲爆| 日本电影欧美片| 蜜臀av一区二区| 中文字幕一区二区三区乱码在线 | 人人爽香蕉精品| 久久蜜臀精品av| 91黄色免费看| 久久av资源站| 一区视频在线播放| 欧美乱妇23p| 国产激情偷乱视频一区二区三区| 亚洲激情图片qvod| 欧美成人一区二区三区在线观看| 成年人网站91| 视频一区二区三区入口| 久久精品亚洲国产奇米99| 91九色最新地址| 国产米奇在线777精品观看| 一区二区三区欧美| 精品日韩一区二区三区免费视频| av在线播放一区二区三区| 久久久久亚洲蜜桃| 日韩美女在线视频| 粉嫩蜜臀av国产精品网站| 亚洲欧美日韩成人高清在线一区| 欧美图区在线视频| 国产毛片精品国产一区二区三区| 一区二区三区在线免费播放| 欧美不卡一区二区| 91天堂素人约啪| 精品中文字幕一区二区| 亚洲一区二区三区四区在线免费观看| 精品欧美乱码久久久久久| 色哟哟一区二区三区| 激情丁香综合五月| 亚洲va中文字幕| 亚洲免费成人av| 国产欧美一区二区精品性色超碰| 欧美一区三区二区|