亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美日韩国产综合视频在线观看| 国产一区不卡精品| 欧美激情一区在线观看| 日韩女优视频免费观看| 欧美精品久久久久久久多人混战| 在线观看一区二区精品视频| 99久久精品一区| 成人激情小说乱人伦| 国产91丝袜在线播放| 成人网页在线观看| 一本一道久久a久久精品| 在线观看精品一区| 精品99999| www久久精品| 国产精品国产三级国产普通话99| 欧美激情在线观看视频免费| 中文字幕一区二区三区不卡| 亚洲欧洲三级电影| 香蕉加勒比综合久久| 蜜桃视频一区二区| 粉嫩13p一区二区三区| 色噜噜狠狠一区二区三区果冻| 色94色欧美sute亚洲线路一ni | 欧美老人xxxx18| 欧美老年两性高潮| 国产视频视频一区| 亚洲另类中文字| 日韩国产一区二| 国产成人在线观看| 欧洲人成人精品| 日韩一区国产二区欧美三区| 国产日韩v精品一区二区| 亚洲精品国产一区二区精华液| 亚洲午夜激情网页| 国产精品一区二区久激情瑜伽| 色呦呦一区二区三区| 日韩欧美一级精品久久| 2017欧美狠狠色| 一区二区三区精品视频| 国产一区二区三区视频在线播放| 色综合视频在线观看| 日韩欧美一区二区免费| 亚洲欧洲av色图| 美女视频免费一区| 欧美日韩中文字幕一区二区| 久久精品男人天堂av| 亚洲成人在线观看视频| 盗摄精品av一区二区三区| 欧美久久久久免费| 亚洲免费大片在线观看| 紧缚奴在线一区二区三区| 日本高清不卡aⅴ免费网站| 久久日韩精品一区二区五区| 亚洲国产日韩在线一区模特| 成人avav影音| 久久日韩粉嫩一区二区三区| 免费黄网站欧美| 欧美绝品在线观看成人午夜影视| 欧美韩国日本综合| 国产一区二区女| 精品少妇一区二区三区日产乱码| 一区二区三区国产豹纹内裤在线| 粉嫩蜜臀av国产精品网站| 日韩美女在线视频| 美女视频黄 久久| 91精品久久久久久久91蜜桃| 亚洲色图一区二区| www.日韩av| 1区2区3区国产精品| 国产成人免费在线| 久久综合久久鬼色中文字| 老色鬼精品视频在线观看播放| 欧美精品日韩一区| 蜜臀精品一区二区三区在线观看 | 韩国三级中文字幕hd久久精品| 色狠狠色狠狠综合| 亚洲一二三四在线| 欧美天堂一区二区三区| 亚洲v日本v欧美v久久精品| 欧美中文字幕不卡| 日韩电影免费在线观看网站| 欧美群妇大交群中文字幕| 日韩精品一区第一页| 欧美一区二区播放| 久久激五月天综合精品| xvideos.蜜桃一区二区| 国产精品综合一区二区三区| 国产亚洲综合在线| aa级大片欧美| 亚洲不卡一区二区三区| 日韩精品一区在线观看| 九九热在线视频观看这里只有精品| 久久综合久久久久88| 成人av电影在线播放| 亚洲高清不卡在线观看| 欧美tickling挠脚心丨vk| 国产一区二区三区黄视频| 国产精品成人午夜| 欧美日韩免费一区二区三区视频| 蜜桃视频在线观看一区| 国产欧美日韩中文久久| 色综合激情五月| 视频一区国产视频| 日本一区二区免费在线观看视频| 91网上在线视频| 美腿丝袜亚洲综合| 亚洲欧洲日韩av| 日韩欧美在线影院| 成人白浆超碰人人人人| 午夜日韩在线电影| 中文字幕乱码久久午夜不卡| 91蜜桃在线观看| 国产一区二区美女| 日韩精品91亚洲二区在线观看| 欧美大片在线观看一区二区| 99久久伊人精品| 奇米色777欧美一区二区| 亚洲视频综合在线| 日韩一区二区精品| 91视视频在线观看入口直接观看www | 美女视频网站久久| 中文字幕在线观看一区| 欧美电影免费观看完整版| 97久久精品人人爽人人爽蜜臀| 日本不卡一区二区| 亚洲乱码一区二区三区在线观看| 日韩欧美国产一区在线观看| 91啪亚洲精品| 国产999精品久久久久久| 男女男精品视频| 香蕉久久一区二区不卡无毒影院 | 国产在线精品视频| 天天综合天天综合色| 亚洲日穴在线视频| 欧美国产成人精品| 久久精品视频网| 欧美sm美女调教| 日韩精品一区二区三区四区 | 精品在线观看免费| 日韩电影网1区2区| 日韩国产高清在线| 国产午夜精品久久久久久久 | 捆绑变态av一区二区三区| 亚洲人精品午夜| 国产欧美精品一区二区三区四区| 欧美不卡视频一区| 日韩一区二区在线看片| 欧美久久久久久久久久| 在线观看日韩高清av| 色网站国产精品| 色香蕉久久蜜桃| 色94色欧美sute亚洲13| 一本色道久久综合亚洲精品按摩| 成人晚上爱看视频| 成人免费看视频| 99re视频精品| 欧日韩精品视频| 欧美日韩亚洲高清一区二区| 欧美三级中文字| 91精品国产一区二区人妖| 日韩视频一区二区在线观看| 日韩欧美国产成人一区二区| 日韩午夜在线影院| 久久人人爽爽爽人久久久| 久久久美女毛片| 国产精品视频观看| 最新不卡av在线| 亚洲午夜精品在线| 美女在线一区二区| 丁香婷婷综合激情五月色| 99视频国产精品| 欧美日韩国产高清一区| 这里只有精品电影| 国产日韩精品一区| 亚洲一区av在线| 美女网站视频久久| 99视频热这里只有精品免费| 色94色欧美sute亚洲线路一ni | 激情欧美一区二区三区在线观看| 久久99精品国产.久久久久| 国产精品亚洲视频| 在线观看不卡一区| 精品国产自在久精品国产| 国产精品久久久久久久久免费丝袜 | 国产精品欧美一区二区三区| 亚洲同性gay激情无套| 婷婷国产在线综合| 国产乱码精品1区2区3区| 日本久久电影网| 91精品久久久久久蜜臀| 欧美激情艳妇裸体舞| 亚洲电影第三页| 大桥未久av一区二区三区中文| 欧美在线影院一区二区| 久久综合资源网| 亚洲电影一级黄| 成人午夜视频网站| 制服.丝袜.亚洲.另类.中文 | 91麻豆精东视频| 精品国产亚洲在线|