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

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

?? os_core.c

?? protues仿真ARM ARM的I2C
?? C
?? 第 1 頁 / 共 5 頁
字號:
        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 (char *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 *parg)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    
    
    parg = parg;                                 /* 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 *parg)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    INT32U     run;
    INT32U     max;
    INT8S      usage;


    parg = parg;                                 /* 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 = (INT32U)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)
{
#if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register */
    OS_CPU_SR  cpu_sr;
#endif    
    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      = 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 > 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 not used     */
        stk_size             = stk_size;
        pbos                 = pbos;
        opt                  = opt;
        id                   = id;
#endif

#if OS_TASK_DEL_EN > 0
        ptcb->OSTCBDelReq    = OS_NO_ERR;
#endif

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

#if OS_EVENT_EN > 0
        ptcb->OSTCBEventPtr  = (OS_EVENT *)0;              /* Task is not pending on an event          */
#endif

#if (OS_VERSION >= 251) && (OS_FLAG_EN > 0) && (OS_MAX_FLAGS > 0) && (OS_TASK_DEL_EN > 0)
        ptcb->OSTCBFlagNode  = (OS_FLAG_NODE *)0;          /* Task is not pending on an event flag     */
#endif

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

#if OS_TASK_PROFILE_EN > 0
        ptcb->OSTCBCtxSwCtr    = 0L;                       /* Initialize profiling variables           */
        ptcb->OSTCBCyclesStart = 0L;
        ptcb->OSTCBCyclesTot   = 0L;
        ptcb->OSTCBStkBase     = (OS_STK *)0;
        ptcb->OSTCBStkUsed     = 0L;
#endif

#if OS_TASK_NAME_SIZE > 1
        ptcb->OSTCBTaskName[0] = '?';                      /* Unknown name at task creation            */
        ptcb->OSTCBTaskName[1] = OS_ASCII_NUL;
#endif

#if OS_VERSION >= 204
        OSTCBInitHook(ptcb);
#endif

        OSTaskCreateHook

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久美女艺术照精彩视频福利播放| 婷婷六月综合亚洲| 亚洲二区在线视频| 激情综合色播激情啊| 色94色欧美sute亚洲线路一ni| 日韩精品在线一区二区| 一区二区三区视频在线看| 国产一区二区毛片| 日韩一区二区视频| 亚洲高清在线视频| 欧洲人成人精品| 中文字幕一区二区在线播放| 国产成人精品影视| 精品国产1区2区3区| 日韩av中文在线观看| 欧美三级日韩三级国产三级| 综合久久久久综合| 99久精品国产| 国产精品久久久久久户外露出| 国产成人精品一区二| 久久久久久久久99精品| 精品一区二区成人精品| 欧美一区二区精美| 美女精品自拍一二三四| 欧美国产日韩在线观看| 久久精品国内一区二区三区| 91精品国产91久久久久久最新毛片| 一区二区三区欧美久久| 91免费国产在线| 亚洲精品免费在线观看| 色欧美乱欧美15图片| 伊人夜夜躁av伊人久久| 欧美羞羞免费网站| 亚洲午夜久久久久久久久久久 | 亚洲精品高清在线观看| 日本乱人伦一区| 一区二区三区成人| 欧美怡红院视频| 午夜视频一区在线观看| 欧美精品色综合| 激情久久五月天| 国产亚洲短视频| 99国产精品视频免费观看| 亚洲综合男人的天堂| 欧美精品粉嫩高潮一区二区| 精品一区二区三区免费毛片爱| 久久蜜桃香蕉精品一区二区三区| 成人国产精品免费网站| 亚洲人精品一区| 欧美理论片在线| 精品一区二区三区香蕉蜜桃 | 白白色亚洲国产精品| 亚洲人一二三区| 欧美日韩另类一区| 韩国av一区二区三区四区| 国产精品久久福利| 欧美日韩三级在线| 国产一区二区久久| 一区二区在线观看视频| 日韩一区二区在线播放| 不卡电影免费在线播放一区| 天堂一区二区在线| 国产精品私人自拍| 欧美人成免费网站| 国产精品18久久久久久vr| 亚洲精品乱码久久久久久黑人| 69堂精品视频| 99久久国产综合精品色伊| 手机精品视频在线观看| 国产精品国产自产拍在线| 欧美一区二区三区成人| 91蜜桃在线观看| 黑人精品欧美一区二区蜜桃| 久久99精品国产.久久久久久| 国产精品天美传媒| 欧美本精品男人aⅴ天堂| 色呦呦国产精品| 国产精品88av| 精品一区二区免费在线观看| 亚洲综合av网| 国产精品国产三级国产普通话蜜臀 | 国产人久久人人人人爽| 欧美裸体一区二区三区| av高清久久久| 国产乱理伦片在线观看夜一区| 亚洲最新视频在线观看| 国产精品高潮呻吟久久| 精品国产凹凸成av人导航| 欧美色视频一区| 色综合 综合色| aaa亚洲精品| 国产成人精品午夜视频免费| 美女视频网站久久| 五月激情综合色| 亚洲国产日韩a在线播放性色| 国产精品国产自产拍高清av王其 | 成人免费的视频| 国产精品一区二区三区乱码| 精品一区二区三区免费| 奇米精品一区二区三区四区| 亚洲超碰97人人做人人爱| 樱花草国产18久久久久| 亚洲欧美日本韩国| 中文字幕中文字幕中文字幕亚洲无线| 欧美精品一区二| 欧美r级电影在线观看| 日韩免费一区二区| 欧美成人乱码一区二区三区| 91精品国产乱码久久蜜臀| 欧美久久久一区| 欧美日韩一区二区在线观看视频 | 成人免费不卡视频| 国产iv一区二区三区| 懂色av一区二区三区蜜臀| 国产福利一区二区三区在线视频| 国产最新精品免费| 成人性生交大片免费 | 国产盗摄视频一区二区三区| 国产成人在线电影| 成人激情免费网站| 91麻豆自制传媒国产之光| 在线观看视频一区| 555www色欧美视频| 精品捆绑美女sm三区| 亚洲一区二区三区在线| 亚洲第一电影网| 麻豆成人91精品二区三区| 国产综合色在线| 99久久婷婷国产综合精品电影| 色综合色狠狠综合色| 欧美日韩精品电影| 精品国产成人系列| 国产精品久久久一本精品| 亚洲一区二区三区三| 久久精品国产一区二区三| 国产成人免费9x9x人网站视频| 91香蕉视频黄| 69堂国产成人免费视频| 久久久久久久网| 一个色在线综合| 精品一区二区三区久久| aaa亚洲精品一二三区| 欧美麻豆精品久久久久久| 久久久99久久| 亚洲成人av福利| 国产成人av一区二区三区在线| 91在线视频播放| 91精品国产综合久久福利| 国产精品乱人伦中文| 同产精品九九九| 国产精品亚洲综合一区在线观看| 色琪琪一区二区三区亚洲区| 精品va天堂亚洲国产| 亚洲综合色在线| 国产福利一区在线| 欧美日韩高清一区二区不卡| 国产三级一区二区| 无码av中文一区二区三区桃花岛| 国产电影一区二区三区| 在线不卡中文字幕播放| 国产精品丝袜在线| 久久国产日韩欧美精品| 在线观看亚洲专区| 国产欧美视频一区二区三区| 婷婷国产在线综合| 色综合欧美在线| 久久精品亚洲精品国产欧美kt∨ | 亚洲午夜精品17c| 成人小视频免费观看| 欧美一区二区三区小说| 一区二区三区在线视频观看58| 粉嫩aⅴ一区二区三区四区| 日韩一区二区电影在线| 香蕉成人啪国产精品视频综合网| 9色porny自拍视频一区二区| 精品国产成人系列| 麻豆传媒一区二区三区| 欧美高清www午色夜在线视频| 日本在线不卡一区| 欧美亚洲国产怡红院影院| 国产精品福利一区| 国产91精品久久久久久久网曝门| 欧美一区二区高清| 日韩国产精品久久| 欧美日韩和欧美的一区二区| 亚洲免费电影在线| a在线欧美一区| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 国产成人精品三级麻豆| 久久久影院官网| 久久精品99久久久| 日韩三级免费观看| 免费观看日韩av| 欧美成人一区二区三区在线观看| 人人狠狠综合久久亚洲| 精品少妇一区二区三区日产乱码 | 欧美日韩精品一区二区三区蜜桃| 亚洲自拍偷拍网站| 欧美日韩国产高清一区二区 | 成人av电影在线播放|