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

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

?? os_task.c

?? uCOS源碼
?? 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一区二区三区免费野_久草精品视频
国产精品夜夜爽| 欧美性xxxxxxxx| 日韩欧美高清dvd碟片| 亚洲欧美激情视频在线观看一区二区三区 | 久久九九久久九九| 激情av综合网| 欧美xxxxx牲另类人与| 日韩黄色免费电影| 日韩精品专区在线影院重磅| 亚洲1区2区3区4区| 欧美日韩国产片| 亚洲成人av中文| 欧美一区二区三区在线视频| 婷婷丁香激情综合| 91精品国产一区二区三区蜜臀| 午夜免费久久看| 欧美成人性福生活免费看| 国产伦精品一区二区三区在线观看 | 黑人巨大精品欧美黑白配亚洲| 日韩精品一区二区三区视频播放| 免费国产亚洲视频| 久久久久久久久久久黄色 | 夜夜嗨av一区二区三区中文字幕| 91久久精品一区二区| 日韩影院在线观看| 久久毛片高清国产| 欧美精品在线一区二区三区| 欧美国产丝袜视频| 蜜臀av在线播放一区二区三区| 在线播放/欧美激情| 久久精品国产精品亚洲精品| 亚洲一二三四久久| 精品免费一区二区三区| 成人av午夜电影| 美女任你摸久久| 中文字幕中文字幕在线一区 | 中文字幕在线观看一区| 欧美亚洲高清一区二区三区不卡| 国产精品69久久久久水密桃 | 国产精品短视频| 亚洲精品一区二区三区99| 99riav一区二区三区| 黑人巨大精品欧美一区| 亚洲777理论| 亚洲国产色一区| 亚洲欧美日韩久久精品| 国产日韩视频一区二区三区| 欧美吻胸吃奶大尺度电影| 99视频精品全部免费在线| 国产一区欧美一区| 精油按摩中文字幕久久| 亚洲不卡在线观看| 亚洲va在线va天堂| 亚洲444eee在线观看| 亚洲图片欧美色图| 亚洲成人综合网站| 美女视频免费一区| 免费在线观看日韩欧美| 日韩福利电影在线观看| 成人激情开心网| caoporen国产精品视频| 99久久99久久精品国产片果冻| 不卡一区中文字幕| 色婷婷久久99综合精品jk白丝| 欧美色成人综合| 91精品国产品国语在线不卡| 成人精品国产一区二区4080| 亚洲国产一区二区三区| 日本女优在线视频一区二区| 蜜桃视频在线观看一区二区| 久久99精品久久久久久国产越南| 精品一区二区av| 99久久综合国产精品| 欧美狂野另类xxxxoooo| 久久蜜桃一区二区| 亚洲国产视频在线| 国产+成+人+亚洲欧洲自线| 欧美性猛片aaaaaaa做受| 日韩一级黄色片| 国产精品色在线观看| 午夜激情久久久| 成人教育av在线| 日韩女优制服丝袜电影| 中文字幕一区二区三区在线观看 | 青青草97国产精品免费观看无弹窗版| 久久精品久久久精品美女| 99久久亚洲一区二区三区青草| 欧美男同性恋视频网站| 国产精品美女久久久久久| 日本成人中文字幕| 在线观看一区二区精品视频| 久久久国产午夜精品| 日韩精品亚洲一区二区三区免费| 成人综合日日夜夜| 日韩视频中午一区| 日韩不卡手机在线v区| 色噜噜狠狠一区二区三区果冻| 精品国偷自产国产一区| 天天综合网天天综合色 | 久久激情五月激情| 日韩一区二区三区免费观看| 亚洲午夜在线视频| 91视视频在线直接观看在线看网页在线看| 精品国产乱码久久久久久夜甘婷婷 | 午夜精品福利一区二区蜜股av | 国内精品伊人久久久久av影院| 国产精品一区在线观看你懂的| 日韩欧美一区在线观看| 亚洲人成网站影音先锋播放| 国产一区二区在线视频| 日韩亚洲欧美在线| 国产精品少妇自拍| 91欧美一区二区| 亚洲欧洲精品一区二区三区| 国产成人精品影视| 国产精品美女久久久久久久 | 国产精品久久久久久久久免费樱桃 | 免费观看91视频大全| 欧美日韩在线一区二区| 香蕉加勒比综合久久| 欧洲人成人精品| 日韩国产在线一| 日韩美女在线视频 | 在线视频一区二区三| 亚洲免费观看高清完整| 色av成人天堂桃色av| 国产精品久久久一本精品| 91丨九色丨国产丨porny| 亚洲精品久久久蜜桃| 欧美精品电影在线播放| 日韩精品欧美成人高清一区二区| 欧美一级片在线| 国产99一区视频免费| 亚洲永久精品国产| 欧美xxx久久| 色婷婷亚洲婷婷| 国产一区二区剧情av在线| 亚洲综合激情小说| 精品日韩在线一区| 欧美午夜精品理论片a级按摩| 国产精品天干天干在线综合| 欧美日韩情趣电影| 麻豆精品国产传媒mv男同| 一区二区在线观看视频| 久久色中文字幕| 91精品国产综合久久久久久久久久| 激情五月婷婷综合| 欧美一级片免费看| 91亚洲精品久久久蜜桃| 另类调教123区 | 欧美大胆一级视频| 色88888久久久久久影院野外| 精品制服美女丁香| 视频一区欧美精品| 亚洲一区二区欧美日韩| 中文字幕不卡在线播放| 欧美成人性战久久| 日韩天堂在线观看| 91精品在线一区二区| 欧美日韩免费视频| 欧美日韩综合在线免费观看| 99在线精品视频| 91在线国产福利| 在线观看av一区二区| 欧美午夜寂寞影院| 亚洲精品一区二区三区影院| 成人午夜激情在线| av色综合久久天堂av综合| 成人性生交大片免费看中文| 国产99久久久国产精品免费看| 狠狠色伊人亚洲综合成人| 国产精品一区二区久激情瑜伽| 国产一区二区三区久久久| 久久99精品国产.久久久久久| 日本不卡的三区四区五区| 日本伊人午夜精品| 免费观看成人av| 91猫先生在线| 欧美日韩在线一区二区| 日韩综合小视频| 成人在线综合网站| 成av人片一区二区| 欧美影视一区在线| 日韩欧美国产一区二区在线播放| 欧美变态口味重另类| 中文字幕成人在线观看| 裸体一区二区三区| 91免费版在线| 26uuu久久综合| 一区二区中文视频| 国产一区二区视频在线| 91高清视频免费看| 国产精品天美传媒沈樵| 中文字幕五月欧美| 99在线热播精品免费| 欧美变态tickling挠脚心| 国产福利91精品一区| 一本到高清视频免费精品| 久久奇米777| 亚洲成人精品一区|