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

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

?? os_core.c

?? ucos porting source for Am188
?? C
?? 第 1 頁 / 共 3 頁
字號:
*                                            OSIdleCtrMax
*
* Arguments  : none
*
* Returns    : none
*********************************************************************************************************
*/

#if OS_TASK_STAT_EN
void OSStatInit (void)
{
    OSTimeDly(2);                                /* Synchronize with clock tick                        */
    OS_ENTER_CRITICAL();
    OSIdleCtr    = 0L;                           /* Clear idle counter                                 */
    OS_EXIT_CRITICAL();
    OSTimeDly(OS_TICKS_PER_SEC);                 /* Determine MAX. idle counter value for 1 second     */
    OS_ENTER_CRITICAL();
    OSIdleCtrMax = OSIdleCtr;                    /* Store maximum idle counter count in 1 second       */
    OSStatRdy    = TRUE;
    OS_EXIT_CRITICAL();
}
#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 waiting for event(s) to occur.
*
* Arguments  : none
*
* Returns    : none
*********************************************************************************************************
*/

void OSTaskIdle (void *pdata)
{
    pdata = pdata;                               /* Prevent compiler warning for not using 'pdata'     */
    for (;;) {
        OS_ENTER_CRITICAL();
        OSIdleCtr++;
        OS_EXIT_CRITICAL();
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                            STATISTICS TASK
*
* Description: This task is internal to uC/OS-II and is used to compute some statistics about the
*              multitasking environment.  Specifically, OSTaskStat() computes the CPU usage.
*              CPU usage is determined by:
*
*                                          OSIdleCtr
*                 OSCPUUsage = 100 * (1 - ------------)     (units are in %)
*                                         OSIdleCtrMax
*
* Arguments  : pdata     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) We delay for 5 seconds in the beginning to allow the system to reach steady state and
*                 have all other tasks created before we do statistics.  You MUST have at least a delay
*                 of 2 seconds to allow for the system to establish the maximum value for the idle 
*                 counter.
*********************************************************************************************************
*/

#if OS_TASK_STAT_EN
void OSTaskStat (void *pdata)
{
    INT32U run;
    INT8S  usage;
    
    
    pdata = pdata;                               /* Prevent compiler warning for not using 'pdata'     */
    while (OSStatRdy == FALSE) {
        OSTimeDly(2 * OS_TICKS_PER_SEC);             /* Wait until statistic task is ready                 */
    }
    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 (OSIdleCtrMax > 0L) {
            usage = (INT8S)(100L - 100L * run / OSIdleCtrMax);
            if (usage > 100) {
                OSCPUUsage = 100;
            } else if (usage < 0) {
                OSCPUUsage =   0;
            } else {
                OSCPUUsage = usage;
            }
        } else {
            OSCPUUsage = 0;
        }
        OSTaskStatHook();                        /* Invoke user definable hook                         */
        OSTimeDly(OS_TICKS_PER_SEC);             /* Accumulate OSIdleCtr for the next second           */
    }
}
#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 OSTCBInit (INT8U prio, OS_STK *ptos, OS_STK *pbos, INT16U id, INT16U stk_size, void *pext, INT16U opt)
{
    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      = (INT8U)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        
        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        
        ptcb->OSTCBDelReq    = OS_NO_ERR;
#endif

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

#if     OS_MBOX_EN || (OS_Q_EN && (OS_MAX_QS >= 2)) || OS_SEM_EN
        ptcb->OSTCBEventPtr  = (OS_EVENT *)0;              /* Task is not pending on an event          */
#endif

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

        OS_ENTER_CRITICAL();
        OSTCBPrioTbl[prio]   = ptcb;
        ptcb->OSTCBNext      = OSTCBList;                  /* Link into TCB chain                      */
        ptcb->OSTCBPrev      = (OS_TCB *)0;
        if (OSTCBList != (OS_TCB *)0) {
            OSTCBList->OSTCBPrev = ptcb;
        }
        OSTCBList               = ptcb;
        OSRdyGrp               |= ptcb->OSTCBBitY;         /* Make task ready to run                   */
        OSRdyTbl[ptcb->OSTCBY] |= ptcb->OSTCBBitX;
        OS_EXIT_CRITICAL();
        return (OS_NO_ERR);
    } else {
        OS_EXIT_CRITICAL();
        return (OS_NO_MORE_TCB);
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                         PROCESS SYSTEM TICK
*
* Description: This function is used to signal to uC/OS-II the occurrence of a 'system tick' (also known
*              as a 'clock tick').  This function should be called by the ticker ISR but, can also be
*              called by a high priority task.
*
* Arguments  : none
*
* Returns    : none
*********************************************************************************************************
*/

void OSTimeTick (void)
{
    OS_TCB *ptcb;

    OSTimeTickHook();                                      /* Call user definable hook                 */
	ptcb = OSTCBList;                                      /* Point at first TCB in TCB list           */
    while (ptcb->OSTCBPrio != OS_IDLE_PRIO) 
	{              										   /* Go through all TCBs in TCB list          */
        OS_ENTER_CRITICAL();
        if (ptcb->OSTCBDly != 0) {                         /* Delayed or waiting for event with TO     */
            if (--ptcb->OSTCBDly == 0) {                   /* Decrement nbr of ticks to end of delay   */
                if (!(ptcb->OSTCBStat & OS_STAT_SUSPEND)) {    /* Is task suspended?                   */
                    OSRdyGrp               |= ptcb->OSTCBBitY; /* No,  Make task Rdy to Run (timed out)*/
                    OSRdyTbl[ptcb->OSTCBY] |= ptcb->OSTCBBitX;
                } else {                                       /* Yes, Leave 1 tick to prevent ...     */
                    ptcb->OSTCBDly = 1;                        /* ... loosing the task when the ...    */
                }                                              /* ... suspension is removed.           */
            }
        }
        ptcb = ptcb->OSTCBNext;                            /* Point at next TCB in TCB list            */
        OS_EXIT_CRITICAL();
    }

    OS_ENTER_CRITICAL();                                   /* Update the 32-bit tick counter           */
    OSTime++;
    OS_EXIT_CRITICAL();
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                             GET VERSION
*
* Description: This function is used to return the version number of uC/OS-II.  The returned value
*              corresponds to uC/OS-II's version number multiplied by 100.  In other words, version 2.00
*              would be returned as 200.
*
* Arguments  : none
*
* Returns    : the version number of uC/OS-II multiplied by 100.
*********************************************************************************************************
*/

INT16U OSVersion (void)
{
    return (OS_VERSION);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品乱码亚洲一区二区不卡| 欧美日韩和欧美的一区二区| 麻豆久久一区二区| 亚洲第一搞黄网站| 一级女性全黄久久生活片免费| 国产欧美日韩三区| 久久久精品免费观看| 久久丝袜美腿综合| 中文字幕精品一区二区三区精品 | 一本久道中文字幕精品亚洲嫩| 国产成人在线观看| www.欧美亚洲| av网站一区二区三区| 91香蕉视频污在线| 欧美性受xxxx黑人xyx性爽| 精品视频一区 二区 三区| 制服丝袜亚洲精品中文字幕| 欧美顶级少妇做爰| 久久天堂av综合合色蜜桃网 | 日本韩国欧美在线| 欧美日韩日本视频| 精品久久久影院| 国产精品久久久久久久久久久免费看| 中文久久乱码一区二区| 亚洲精品日韩专区silk| 婷婷国产在线综合| 国产综合久久久久久鬼色| 波多野洁衣一区| 在线观看一区日韩| 精品久久久久久无| 最新成人av在线| 日本不卡视频在线观看| 成人av网址在线观看| 欧美三级欧美一级| 国产午夜精品一区二区| 亚洲区小说区图片区qvod| 蜜桃一区二区三区在线| 成人av在线网站| 日韩欧美在线1卡| 亚洲欧美偷拍另类a∨色屁股| 日韩电影在线一区二区三区| 国产99久久精品| 555夜色666亚洲国产免| 国产精品女同互慰在线看| 日韩中文字幕91| 91视频精品在这里| 亚洲精品一区二区三区香蕉| 亚洲自拍偷拍九九九| 国产精品一卡二卡在线观看| 5566中文字幕一区二区电影| 成人欧美一区二区三区1314 | 在线精品视频免费播放| 欧美成人在线直播| 夜色激情一区二区| 国产98色在线|日韩| 欧美精品色一区二区三区| 中文字幕在线观看不卡视频| 国产在线国偷精品产拍免费yy| 欧美性高清videossexo| 国产精品久久久久久一区二区三区| 蜜臀av在线播放一区二区三区| 97精品久久久久中文字幕| 欧美videos中文字幕| 日本中文字幕一区二区有限公司| 色综合中文综合网| 91美女视频网站| 久久久久99精品一区| 日本人妖一区二区| 欧美一级爆毛片| 午夜在线电影亚洲一区| 欧美日韩国产高清一区二区| 中文字幕亚洲精品在线观看 | 在线中文字幕一区二区| 中文字幕二三区不卡| 风间由美一区二区三区在线观看| 久久久久久电影| 国产乱码一区二区三区| 久久免费电影网| 国产麻豆日韩欧美久久| 国产欧美日韩亚州综合| 粉嫩aⅴ一区二区三区四区| 欧美激情一区二区| av电影在线观看一区| 亚洲欧美日韩一区二区| 91久久人澡人人添人人爽欧美| 亚洲另类一区二区| 欧美美女喷水视频| 免费在线视频一区| 26uuu精品一区二区| 粉嫩一区二区三区性色av| 国产精品久久久久久福利一牛影视 | 欧美经典一区二区| 不卡电影免费在线播放一区| 亚洲精品高清视频在线观看| 欧美图区在线视频| 精品亚洲成a人| 欧美国产97人人爽人人喊| 一本久久精品一区二区| 日本视频免费一区| 日本一区二区三级电影在线观看 | 激情久久五月天| 久久精品一区二区三区不卡牛牛| 成人精品小蝌蚪| 亚洲一区在线视频| 精品国产精品网麻豆系列| 国产成人免费网站| 亚洲成人免费在线| 欧美激情综合五月色丁香| 在线视频一区二区免费| 国产一区二区日韩精品| 亚洲欧洲日产国码二区| 91精品国产高清一区二区三区蜜臀| 九九九精品视频| 一区二区三区在线看| 91精品一区二区三区久久久久久 | 成人av免费在线观看| 亚洲国产精品人人做人人爽| 欧美精品一区二区三区视频| caoporn国产精品| 久久99精品国产麻豆婷婷| 亚洲激情成人在线| 久久久91精品国产一区二区精品| 欧美在线|欧美| 99久久免费精品高清特色大片| 久久精品二区亚洲w码| 亚洲欧美电影院| 欧美高清在线一区| 欧美xxxx老人做受| 欧美日韩精品一区二区三区蜜桃 | 欧美日韩国产影片| 懂色av一区二区在线播放| 麻豆精品久久精品色综合| 亚洲精品日日夜夜| 最新日韩在线视频| 国产精品毛片高清在线完整版| 日韩免费福利电影在线观看| 在线免费观看不卡av| 99国产精品久久久久久久久久| 国产一区二区三区四区在线观看| 免费日本视频一区| 日韩国产一二三区| 视频一区视频二区在线观看| 亚洲天堂久久久久久久| 日本一区二区三区dvd视频在线| 欧美不卡一二三| 日韩午夜中文字幕| 日韩欧美第一区| 日韩欧美卡一卡二| 91精品国产综合久久久久久| 欧美日本国产视频| 欧美日韩视频不卡| 欧美一区日韩一区| 日韩欧美一区二区视频| 日韩欧美一级在线播放| 91精品国产综合久久福利| 欧美日韩午夜精品| 欧美一区二区视频在线观看2020| 欧美精品日韩一本| 日韩精品影音先锋| 久久久欧美精品sm网站| 欧美国产禁国产网站cc| 国产精品九色蝌蚪自拍| 夜夜揉揉日日人人青青一国产精品| 亚洲欧美另类在线| 亚洲成人免费在线| 六月丁香婷婷色狠狠久久| 国产一区二区三区蝌蚪| 成人精品视频.| 在线观看日韩国产| 6080日韩午夜伦伦午夜伦| 日韩手机在线导航| 国产亚洲欧洲一区高清在线观看| 中文字幕精品一区二区精品绿巨人| 国产精品麻豆久久久| 亚洲精品福利视频网站| 日韩av电影一区| 丁香网亚洲国际| 欧美三级欧美一级| 久久精品一二三| 一区二区三区四区激情 | 欧美成人女星排名| 欧美激情一区二区三区不卡 | 久久不见久久见免费视频7| 国产一二精品视频| 色婷婷av一区二区| 精品入口麻豆88视频| 中文字幕在线播放不卡一区| 亚洲aⅴ怡春院| 国产成人在线影院| 欧美视频一区在线| 国产色产综合产在线视频| 亚洲一线二线三线视频| 国产精品一二三区在线| 91成人在线精品| 久久天天做天天爱综合色| 亚洲一卡二卡三卡四卡无卡久久| 精品中文字幕一区二区| 色综合久久久久| 国产丝袜美腿一区二区三区| 午夜电影网一区|