亚洲欧美第一页_禁久久精品乱码_粉嫩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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色屁屁一区二区| 国产精品一区二区91| 欧美精品色一区二区三区| 亚洲国产人成综合网站| 欧美欧美欧美欧美| 午夜天堂影视香蕉久久| 精品国产一区二区三区av性色| 国产真实乱偷精品视频免| 国产精品免费久久| 91福利在线免费观看| 日本中文在线一区| 精品国产电影一区二区| 不卡av在线免费观看| 亚洲成av人片观看| 亚洲精品在线免费播放| 91视频.com| 美女精品自拍一二三四| 亚洲高清免费观看 | 亚洲免费高清视频在线| 欧美性大战久久久| 国产九色sp调教91| 一区av在线播放| 精品国产制服丝袜高跟| 91网上在线视频| 久久国产剧场电影| 亚洲色图清纯唯美| 精品剧情v国产在线观看在线| 粉嫩嫩av羞羞动漫久久久 | 精品免费视频一区二区| 99久久久久久| 久久国产人妖系列| 一区二区三区中文字幕电影 | 色综合天天综合在线视频| 强制捆绑调教一区二区| 中文字幕亚洲一区二区va在线| 欧美片网站yy| 一本大道久久a久久综合婷婷| 麻豆精品久久精品色综合| 亚洲男人的天堂网| 久久精品人人做人人综合 | 色欧美片视频在线观看| 美腿丝袜在线亚洲一区| 亚洲综合久久av| 国产片一区二区三区| 日韩一区二区在线观看视频| 日本精品一区二区三区高清| 国产精品白丝jk黑袜喷水| 人妖欧美一区二区| 亚洲高清免费观看高清完整版在线观看 | 欧美一区二区三区在线观看| www.欧美精品一二区| 狠狠色丁香婷综合久久| 亚洲国产美女搞黄色| 136国产福利精品导航| 久久你懂得1024| 精品电影一区二区| 欧美一二三区精品| 91精品国产一区二区三区香蕉| 91精品1区2区| 在线免费视频一区二区| 99国产精品久久久久久久久久| 国产成人午夜高潮毛片| 国产制服丝袜一区| 国产在线播放一区二区三区 | 国产一区二区三区久久久| 视频精品一区二区| 午夜精品视频一区| 午夜久久久影院| 亚洲一二三区视频在线观看| 亚洲码国产岛国毛片在线| 免费看黄色91| 久久99精品久久久久| 蜜桃一区二区三区在线| 日本视频一区二区三区| 日韩中文字幕一区二区三区| 亚洲图片自拍偷拍| 日本亚洲三级在线| 另类小说欧美激情| 国产自产高清不卡| 国产黄人亚洲片| av在线综合网| 日本黄色一区二区| 欧美色倩网站大全免费| 欧美日韩久久不卡| 制服丝袜激情欧洲亚洲| 日韩三级伦理片妻子的秘密按摩| 欧美一级日韩不卡播放免费| 精品国产乱码久久| 国产精品少妇自拍| 一区二区三区不卡视频在线观看| 亚洲成人激情自拍| 久久成人免费网| 国产99久久久精品| 91国模大尺度私拍在线视频| 欧美剧情电影在线观看完整版免费励志电影| 欧美精品欧美精品系列| 2023国产精品| 国产精品网站一区| 亚洲福利电影网| 国产在线精品一区二区夜色| 国产成人免费视频一区| 91性感美女视频| 91麻豆精品国产91久久久使用方法| 精品欧美一区二区在线观看| 国产午夜精品一区二区| 一区二区在线看| 免费看精品久久片| 99久精品国产| 日韩一区二区在线观看视频| 中文字幕不卡在线播放| 五月婷婷激情综合网| 加勒比av一区二区| 91精品福利视频| 久久综合网色—综合色88| 一区二区三区免费在线观看| 蜜臀av性久久久久蜜臀aⅴ| 不卡一卡二卡三乱码免费网站| 在线精品视频一区二区三四| 久久亚洲二区三区| 亚洲午夜精品在线| 国产91精品一区二区麻豆网站| 欧美午夜不卡视频| 国产蜜臀97一区二区三区| 婷婷六月综合网| 99精品久久99久久久久| 精品国精品国产| 亚洲福利一区二区三区| 国产精品18久久久| 日韩一区二区免费在线观看| 亚洲欧美另类小说视频| 久久66热re国产| 69堂国产成人免费视频| 亚洲色大成网站www久久九九| 老司机精品视频在线| 欧美视频自拍偷拍| 亚洲欧美自拍偷拍| 精品亚洲aⅴ乱码一区二区三区| 欧美性猛交xxxxxx富婆| 国产精品久久久99| 国产黄色成人av| 精品欧美一区二区在线观看| 亚洲大型综合色站| 色综合天天综合网天天狠天天| 国产性做久久久久久| 玖玖九九国产精品| 7777女厕盗摄久久久| 亚洲一卡二卡三卡四卡五卡| av亚洲精华国产精华精| 欧美国产日韩a欧美在线观看| 久热成人在线视频| 日韩一区二区三区视频| 首页国产欧美久久| 7777精品伊人久久久大香线蕉经典版下载| 亚洲美女电影在线| 91无套直看片红桃| 亚洲女同ⅹxx女同tv| 99久久夜色精品国产网站| 国产精品日韩成人| 国产盗摄一区二区| 久久精品免视看| 激情国产一区二区| 精品久久久久久无| 激情文学综合插| 久久色成人在线| 福利视频网站一区二区三区| 国产日韩欧美亚洲| 9人人澡人人爽人人精品| 国产精品美女久久久久av爽李琼| 成人黄色片在线观看| 国产精品国产三级国产aⅴ中文| 成人av免费在线观看| 国产精品久久久久永久免费观看| www.日本不卡| 亚洲精品成人少妇| 欧美色精品在线视频| 日本aⅴ精品一区二区三区| 日韩美女一区二区三区| 国产麻豆精品在线观看| 国产欧美日韩视频一区二区| 成人免费黄色大片| 亚洲免费电影在线| 欧美猛男超大videosgay| 免费成人av在线| 国产日韩欧美在线一区| 91在线观看下载| 午夜国产精品一区| 精品国产1区二区| 成人午夜激情视频| 亚洲午夜免费电影| 精品久久久久久久人人人人传媒 | 欧美精品一区二区三区在线 | 欧美—级在线免费片| 99国产精品久久久久久久久久久| 亚洲一区二区三区四区五区黄| 欧美一区二区三区在| 岛国av在线一区| 亚洲国产成人av好男人在线观看| 欧美一区二区三区视频在线| 国产成人av影院| 亚洲一区二区五区|