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

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

?? os_task.c

?? S3C44B0X全套培訓資料及源代碼,是ARM入門非常實用的東西
?? C
?? 第 1 頁 / 共 3 頁
字號:
/***********************************************************************************************************                                                uC/OS-II*                                          The Real-Time Kernel*                                            TASK MANAGEMENT**                        (c) Copyright 1992-1998, Jean J. Labrosse, Plantation, FL*                                           All Rights Reserved**                                                  V2.00** File : OS_TASK.C* By   : Jean J. Labrosse**********************************************************************************************************/#ifndef  OS_MASTER_FILE#include "includes.h"#endif/***********************************************************************************************************                                        LOCAL FUNCTION PROTOTYPES**********************************************************************************************************/static  void  OSDummy(void);/***********************************************************************************************************                                            DUMMY FUNCTION** Description: This function doesn't do anything.  It is called by OSTaskDel() to ensure that interrupts*              are disabled immediately after they are enabled.** Arguments  : none** Returns    : none**********************************************************************************************************/static void  OSDummy (void){}/*$PAGE*//***********************************************************************************************************                                        CHANGE PRIORITY OF A TASK** Description: This function allows you to change the priority of a task dynamically.  Note that the new*              priority MUST be available.** Arguments  : oldp     is the old priority**              newp     is the new priority** Returns    : OS_NO_ERR        is the call was successful*              OS_PRIO_INVALID  if the priority you specify is higher that the maximum allowed *                               (i.e. >= OS_LOWEST_PRIO)*              OS_PRIO_EXIST    if the new priority already exist.*              OS_PRIO_ERR      there is no task with the specified OLD priority (i.e. the OLD task does*                               not exist.**********************************************************************************************************/#if OS_TASK_CHANGE_PRIO_ENINT8U OSTaskChangePrio (INT8U oldprio, INT8U newprio){    OS_TCB   *ptcb;    OS_EVENT *pevent;    INT8U     x;    INT8U     y;    INT8U     bitx;    INT8U     bity;    if ((oldprio >= OS_LOWEST_PRIO && oldprio != OS_PRIO_SELF)  ||          newprio >= OS_LOWEST_PRIO) {        return (OS_PRIO_INVALID);    }    OS_ENTER_CRITICAL();    if (OSTCBPrioTbl[newprio] != (OS_TCB *)0) {                 /* New priority must not already exist */        OS_EXIT_CRITICAL();        return (OS_PRIO_EXIST);    } else {        OSTCBPrioTbl[newprio] = (OS_TCB *)1;                    /* Reserve the entry to prevent others */        OS_EXIT_CRITICAL();        y    = newprio >> 3;                                    /* Precompute to reduce INT. latency   */        bity = OSMapTbl[y];        x    = newprio & 0x07;        bitx = OSMapTbl[x];        OS_ENTER_CRITICAL();        if (oldprio == OS_PRIO_SELF) {                          /* See if changing self                */            oldprio = OSTCBCur->OSTCBPrio;                      /* Yes, get priority                   */        }        if ((ptcb = OSTCBPrioTbl[oldprio]) != (OS_TCB *)0) {    /* Task to change must exist           */            OSTCBPrioTbl[oldprio] = (OS_TCB *)0;                /* Remove TCB from old priority        */            if (OSRdyTbl[ptcb->OSTCBY] & ptcb->OSTCBBitX) {     /* If task is ready make it not ready  */                if ((OSRdyTbl[ptcb->OSTCBY] &= ~ptcb->OSTCBBitX) == 0) {                    OSRdyGrp &= ~ptcb->OSTCBBitY;                }                OSRdyGrp    |= bity;                            /* Make new priority ready to run      */                OSRdyTbl[y] |= bitx;            } else {                if ((pevent = ptcb->OSTCBEventPtr) != (OS_EVENT *)0) { /* Remove from event wait list  */                    if ((pevent->OSEventTbl[ptcb->OSTCBY] &= ~ptcb->OSTCBBitX) == 0) {                        pevent->OSEventGrp &= ~ptcb->OSTCBBitY;                    }                    pevent->OSEventGrp    |= bity;              /* Add new priority to wait list       */                    pevent->OSEventTbl[y] |= bitx;                }            }            OSTCBPrioTbl[newprio] = ptcb;                       /* Place pointer to TCB @ new priority */            ptcb->OSTCBPrio       = newprio;                    /* Set new task priority               */            ptcb->OSTCBY          = y;            ptcb->OSTCBX          = x;            ptcb->OSTCBBitY       = bity;            ptcb->OSTCBBitX       = bitx;            OS_EXIT_CRITICAL();            OSSched();                                          /* Run highest priority task ready     */            return (OS_NO_ERR);        } else {            OSTCBPrioTbl[newprio] = (OS_TCB *)0;                /* Release the reserved prio.          */            OS_EXIT_CRITICAL();            return (OS_PRIO_ERR);                               /* Task to change didn't exist         */        }    }}#endif/*$PAGE*//***********************************************************************************************************                                            CREATE A TASK** Description: This function is used to have uC/OS-II manage the execution of a task.  Tasks can either*              be created prior to the start of multitasking or by a running task.  A task cannot be*              created by an ISR.** Arguments  : task     is a pointer to the task's code**              pdata    is a pointer to an optional data area which can be used to pass parameters to*                       the task when the task first executes.  Where the task is concerned it thinks*                       it was invoked and passed the argument 'pdata' as follows:**                           void Task (void *pdata)*                           {*                               for (;;) {*                                   Task code;*                               }*                           }**              ptos     is a pointer to the task's top of stack.  If the configuration constant *                       OS_STK_GROWTH is set to 1, the stack is assumed to grow downward (i.e. from high*                       memory to low memory).  'pstk' will thus point to the highest (valid) memory *                       location of the stack.  If OS_STK_GROWTH is set to 0, 'pstk' will point to the *                       lowest memory location of the stack and the stack will grow with increasing*                       memory locations.**              prio     is the task's priority.  A unique priority MUST be assigned to each task and the*                       lower the number, the higher the priority.** Returns    : OS_NO_ERR        if the function was successful.*              OS_PRIO_EXIT     if the task priority already exist *                               (each task MUST have a unique priority).*              OS_PRIO_INVALID  if the priority you specify is higher that the maximum allowed *                               (i.e. >= OS_LOWEST_PRIO)**********************************************************************************************************/#if OS_TASK_CREATE_ENINT8U OSTaskCreate (void (*task)(void *pd), void *pdata, OS_STK *ptos, INT8U prio){    void   *psp;    INT8U   err;    if (prio > OS_LOWEST_PRIO) {             /* Make sure priority is within allowable range           */        return (OS_PRIO_INVALID);    }    OS_ENTER_CRITICAL();    if (OSTCBPrioTbl[prio] == (OS_TCB *)0) { /* Make sure task doesn't already exist at this priority  */        OSTCBPrioTbl[prio] = (OS_TCB *)1;    /* Reserve the priority to prevent others from doing ...  */                                             /* ... the same thing until task is created.              */        OS_EXIT_CRITICAL();        psp = (void *)OSTaskStkInit(task, pdata, ptos, 0); /* Initialize the task's stack              */        err = OSTCBInit(prio, psp, (void *)0, 0, 0, (void *)0, 0);                 if (err == OS_NO_ERR) {            OS_ENTER_CRITICAL();            OSTaskCtr++;                                   /* Increment the #tasks counter             */            OSTaskCreateHook(OSTCBPrioTbl[prio]);          /* Call user defined hook                   */            OS_EXIT_CRITICAL();            if (OSRunning) {                 /* Find highest priority task if multitasking has started */                OSSched();            }        } else {            OS_ENTER_CRITICAL();            OSTCBPrioTbl[prio] = (OS_TCB *)0;/* Make this priority available to others                 */            OS_EXIT_CRITICAL();        }        return (err);    } else {        OS_EXIT_CRITICAL();        return (OS_PRIO_EXIST);    }}#endif/*$PAGE*//***********************************************************************************************************                                     CREATE A TASK (Extended Version)** Description: This function is used to have uC/OS-II manage the execution of a task.  Tasks can either*              be created prior to the start of multitasking or by a running task.  A task cannot be*              created by an ISR.  This function is similar to OSTaskCreate() except that it allows*              additional information about a task to be specified.** Arguments  : task     is a pointer to the task's code**              pdata    is a pointer to an optional data area which can be used to pass parameters to*                       the task when the task first executes.  Where the task is concerned it thinks*                       it was invoked and passed the argument 'pdata' as follows:**                           void Task (void *pdata)*                           {*                               for (;;) {*                                   Task code;*                               }*                           }**              ptos     is a pointer to the task's top of stack.  If the configuration constant *                       OS_STK_GROWTH is set to 1, the stack is assumed to grow downward (i.e. from high*                       memory to low memory).  'pstk' will thus point to the highest (valid) memory *                       location of the stack.  If OS_STK_GROWTH is set to 0, 'pstk' will point to the *                       lowest memory location of the stack and the stack will grow with increasing*                       memory locations.  'pstk' MUST point to a valid 'free' data item.**              prio     is the task's priority.  A unique priority MUST be assigned to each task and the*                       lower the number, the higher the priority.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色天使色偷偷av一区二区| 国产精品一级二级三级| 亚洲另类春色国产| 亚洲视频在线一区| 一区二区在线观看免费 | 亚洲欧洲99久久| 久久久久久麻豆| 国产精品毛片久久久久久| 国产精品成人免费精品自在线观看| 欧美一级xxx| 久久天天做天天爱综合色| 久久这里只有精品视频网| 国产精品久久精品日日| 一区二区三区在线观看视频| 亚洲免费视频成人| 美国一区二区三区在线播放| 国产馆精品极品| 欧美亚洲禁片免费| 亚洲国产精品一区二区久久 | 亚洲男人的天堂网| 亚洲国产精品嫩草影院| 国产精品一区二区x88av| 91亚洲大成网污www| 91精品国产乱| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 夜夜嗨av一区二区三区中文字幕| 另类人妖一区二区av| 日本丰满少妇一区二区三区| 精品国产三级a在线观看| 亚洲午夜精品17c| 99久久精品免费| 久久综合一区二区| 日韩高清欧美激情| 欧美猛男超大videosgay| 国产欧美日韩中文久久| 精品在线播放午夜| 欧美一区二区三区啪啪| 亚洲无人区一区| 欧美视频一区在线| 亚洲精品网站在线观看| 91丨porny丨国产入口| 中文字幕在线免费不卡| 91在线视频播放| 一区二区免费视频| 欧美伊人久久大香线蕉综合69| 1区2区3区精品视频| 色婷婷精品久久二区二区蜜臂av| 最新国产成人在线观看| 91麻豆产精品久久久久久| 玉米视频成人免费看| 欧美视频一区在线| 久久成人av少妇免费| 国产亚洲视频系列| 在线日韩一区二区| 蜜桃久久久久久| 国产午夜精品久久久久久免费视| 成人涩涩免费视频| 亚洲免费毛片网站| 欧美午夜片在线看| 国产美女视频一区| 亚洲一区成人在线| 久久久国产午夜精品| 91美女在线观看| 精品无码三级在线观看视频| 国产视频亚洲色图| 777久久久精品| 国产成人夜色高潮福利影视| 亚洲自拍偷拍九九九| 日韩欧美国产三级| 色婷婷久久一区二区三区麻豆| 日本欧美久久久久免费播放网| 久久久高清一区二区三区| 色综合一个色综合亚洲| 国产美女一区二区三区| 全部av―极品视觉盛宴亚洲| 中文字幕中文字幕在线一区| 久久午夜色播影院免费高清| 日本国产一区二区| 99久久免费国产| 久久色.com| 91精品在线免费| 国产99一区视频免费| 亚洲一区二区黄色| 亚洲精品乱码久久久久久黑人 | 中文天堂在线一区| 欧美tk—视频vk| 日韩视频国产视频| 欧美一区二区大片| 日韩一区二区精品| 日韩一区二区三区视频在线 | 亚洲精品中文在线观看| 最好看的中文字幕久久| 亚洲同性gay激情无套| 综合婷婷亚洲小说| 亚洲风情在线资源站| 一级精品视频在线观看宜春院| 亚洲欧美日韩系列| 亚洲福利国产精品| 激情深爱一区二区| 豆国产96在线|亚洲| 欧美午夜宅男影院| 欧美成人一区二区三区| 国产网红主播福利一区二区| 国产精品无人区| 性感美女极品91精品| 精品一区二区免费| 欧美手机在线视频| 久久天堂av综合合色蜜桃网 | 91免费国产视频网站| 7777精品伊人久久久大香线蕉| 日本一区二区三区四区 | 欧美三级日韩三级国产三级| 精品福利在线导航| 亚洲男人的天堂在线aⅴ视频| 麻豆91在线看| 欧美日韩精品三区| 亚洲欧美激情小说另类| 国产在线一区观看| 在线播放91灌醉迷j高跟美女| 中文字幕第一区| 国产在线视频一区二区| 91精品国产综合久久久蜜臀图片| 国产偷国产偷亚洲高清人白洁| 婷婷综合另类小说色区| 欧美性做爰猛烈叫床潮| 一区二区中文字幕在线| 激情文学综合丁香| 日韩视频永久免费| 日韩精品亚洲专区| 欧美亚洲愉拍一区二区| 一区二区三区美女| 一本色道综合亚洲| 亚洲精品国产精华液| 在线观看日韩av先锋影音电影院| 日韩三级在线观看| 亚洲6080在线| 欧美日本国产视频| 日韩高清欧美激情| 久久这里都是精品| 粗大黑人巨茎大战欧美成人| 国产日韩欧美高清| 99re这里只有精品视频首页| 中文字幕不卡的av| 色伊人久久综合中文字幕| 亚洲激情第一区| 91 com成人网| 国产乱一区二区| 亚洲精品国产第一综合99久久| 91传媒视频在线播放| 亚洲一区二区三区三| 88在线观看91蜜桃国自产| 日韩视频一区二区三区在线播放| 久久欧美中文字幕| 91视频精品在这里| 视频一区欧美日韩| 国产精品人人做人人爽人人添| 色屁屁一区二区| 国产传媒欧美日韩成人| 依依成人综合视频| 国产日韩欧美在线一区| 欧美日韩精品专区| 成人高清免费观看| 韩国三级在线一区| 午夜视频一区在线观看| 亚洲视频在线观看三级| 久久毛片高清国产| 337p亚洲精品色噜噜噜| 91在线小视频| 99热99精品| 99精品一区二区三区| 激情久久久久久久久久久久久久久久| 亚洲婷婷在线视频| 国产精品无码永久免费888| 久久婷婷综合激情| 久久综合久久综合久久综合| 91精品国产色综合久久ai换脸 | 日本一区二区视频在线观看| 日韩手机在线导航| 日韩午夜在线观看| 日韩欧美一二三区| 日韩欧美中文一区| 精品日韩欧美在线| 国产日韩欧美亚洲| 国产精品电影院| 亚洲视频在线一区观看| 亚洲成人免费电影| 蜜臀精品一区二区三区在线观看| 天天影视涩香欲综合网| 美国av一区二区| 国产乱码精品一区二区三区av| 国产成人在线视频网站| 一本久道久久综合中文字幕| 777久久久精品| 欧美激情中文不卡| 午夜视频一区在线观看| 国产一区二区免费看| 欧洲精品中文字幕| 欧美一级日韩不卡播放免费| 国产精品另类一区| 国产精品毛片a∨一区二区三区|