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

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

?? 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一区二区三区免费野_久草精品视频
欧美日韩精品免费| 一区二区三区在线视频播放| 国产精品日产欧美久久久久| 亚洲成a人v欧美综合天堂| 成人激情校园春色| 3atv在线一区二区三区| 自拍偷拍欧美激情| 国产成人丝袜美腿| 精品国产伦一区二区三区观看体验 | 天堂成人国产精品一区| 本田岬高潮一区二区三区| 精品精品国产高清一毛片一天堂| 亚洲一级二级三级在线免费观看| proumb性欧美在线观看| 2021中文字幕一区亚洲| 人人精品人人爱| 91麻豆精品国产91久久久| 亚洲综合久久av| 91成人在线观看喷潮| 亚洲欧美一区二区三区国产精品 | 亚洲私人影院在线观看| 成人av在线网站| 亚洲国产精品传媒在线观看| 国产成人精品免费| 久久精品一区四区| 国产成人夜色高潮福利影视| 国产欧美日韩视频在线观看| 国产盗摄一区二区| 久久精品视频网| 国产一区二区三区高清播放| 久久久精品tv| 风间由美一区二区av101| 国产午夜精品一区二区| 国产成人在线影院| 日韩一区中文字幕| 欧美综合在线视频| 亚洲va欧美va国产va天堂影院| 欧美三级日韩三级国产三级| 午夜激情一区二区| 日韩精品中文字幕在线不卡尤物| 久久99精品久久久久久| 国产农村妇女精品| 91在线国产观看| 亚洲综合一区二区精品导航| 在线播放一区二区三区| 激情综合亚洲精品| 国产日本一区二区| 色欧美片视频在线观看在线视频| 亚洲高清视频在线| 欧美电影免费观看高清完整版在| 国产一区二区三区免费播放 | 亚洲成人动漫精品| 日韩亚洲欧美综合| 国产激情一区二区三区| 亚洲欧洲99久久| 欧美日韩国产首页在线观看| 精品在线一区二区三区| 国产精品国产三级国产aⅴ入口| 色狠狠av一区二区三区| 麻豆精品蜜桃视频网站| 中文久久乱码一区二区| 欧美亚洲高清一区二区三区不卡| 美国三级日本三级久久99| 国产精品久久久久久亚洲毛片| www.激情成人| 麻豆免费精品视频| 欧美一区二区三区免费在线看 | 成人欧美一区二区三区| 欧美日韩高清一区二区三区| 国内精品免费在线观看| 一区二区在线看| 久久亚洲综合av| 91搞黄在线观看| 国产一区二区在线视频| 亚洲毛片av在线| 欧美成人性战久久| 色一区在线观看| 国产精品影音先锋| 香蕉乱码成人久久天堂爱免费| 精品日韩一区二区三区| 99国产精品国产精品毛片| 麻豆成人在线观看| 亚洲一区二区三区美女| 国产精品天干天干在观线| 日韩欧美高清在线| 欧美日韩视频专区在线播放| 99久久免费精品高清特色大片| 美女精品自拍一二三四| 亚洲成av人片在www色猫咪| 中文在线一区二区| 精品国产精品网麻豆系列| 在线精品视频免费观看| 97成人超碰视| 成人小视频在线| 国产精品一区在线观看乱码| 青青青爽久久午夜综合久久午夜| 亚洲人成影院在线观看| 国产精品免费丝袜| 久久先锋资源网| 欧美v国产在线一区二区三区| 欧美婷婷六月丁香综合色| 99精品1区2区| 91美女片黄在线观看91美女| 懂色av一区二区夜夜嗨| 国产一区二区三区四区五区美女| 看片网站欧美日韩| 美女久久久精品| 久久电影网电视剧免费观看| 蜜桃免费网站一区二区三区| 日本中文一区二区三区| 日韩高清不卡一区二区三区| 视频一区在线播放| 日精品一区二区三区| 日韩精品1区2区3区| 日韩一区精品视频| 蜜臀av性久久久久蜜臀aⅴ四虎| 日本成人超碰在线观看| 免费观看一级特黄欧美大片| 久久精品免费观看| 韩日精品视频一区| 成人午夜在线视频| 一本大道av一区二区在线播放| 一本一本大道香蕉久在线精品| 日本久久电影网| 欧美乱熟臀69xxxxxx| 日韩视频不卡中文| 国产亚洲一区字幕| 亚洲欧美一区二区三区孕妇| 午夜视黄欧洲亚洲| 久久国产免费看| 成人黄色软件下载| 在线观看亚洲专区| 日韩视频免费直播| 国产欧美精品国产国产专区| 亚洲啪啪综合av一区二区三区| 亚洲一区二区av电影| 男人的天堂久久精品| 国产成人综合在线观看| 91视频国产资源| 欧美精选一区二区| 国产视频一区在线播放| 一区二区久久久久| 久久精品99国产国产精| 成人黄色小视频| 91精品国产福利在线观看| 久久免费精品国产久精品久久久久| 中文字幕一区三区| 日韩专区欧美专区| 波多野结衣中文一区| 欧美日韩国产综合一区二区三区| 欧美电影免费观看高清完整版| 国产精品传媒在线| 蜜桃视频在线观看一区二区| 99re成人精品视频| 正在播放一区二区| 亚洲丝袜精品丝袜在线| 久久精品国产精品亚洲综合| 91丨九色丨蝌蚪丨老版| 久久先锋影音av鲁色资源网| 一区二区三区精品| 懂色av中文字幕一区二区三区| 欧美日韩国产首页| 亚洲桃色在线一区| 国产成人超碰人人澡人人澡| 欧美日产在线观看| 亚洲男同性恋视频| 国产成人免费网站| 欧美一卡二卡三卡| 一级女性全黄久久生活片免费| 国产成人精品aa毛片| 欧美mv日韩mv国产网站app| 一区二区三区中文字幕电影 | 国产一区二区不卡老阿姨| 欧美日韩国产经典色站一区二区三区| 久久久综合视频| 免费观看久久久4p| 欧美精品免费视频| 亚洲综合免费观看高清完整版在线 | 粉嫩av一区二区三区粉嫩| 日韩一区二区三区免费观看| 一片黄亚洲嫩模| a级精品国产片在线观看| 久久精品视频在线看| 麻豆精品国产传媒mv男同| 欧美三级在线看| 亚洲自拍偷拍九九九| 91美女视频网站| 亚洲免费视频中文字幕| 91影院在线观看| 亚洲猫色日本管| 91蜜桃传媒精品久久久一区二区| 国产精品久久久久影院亚瑟 | 国产在线日韩欧美| 日韩欧美高清一区| 精品一区二区三区影院在线午夜| 91精品国产福利| 久久69国产一区二区蜜臀| 日韩精品一区二区三区在线 | 中文欧美字幕免费| www.在线欧美|