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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? os_task.c

?? 51單片機web的ucosii
?? 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    <CORE\includes.h> 
#endif

/*
*********************************************************************************************************
*                                        LOCAL FUNCTION PROTOTYPES
*********************************************************************************************************
*/


static  void  OSDummy(void) reentrant;

/*
*********************************************************************************************************
*                                            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) reentrant
{
}

/*$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_EN
INT8U OSTaskChangePrio (INT8U oldprio, INT8U newprio) reentrant
{
    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_EN
INT8U OSTaskCreate (void (*task)(void *pd), void *ppdata, OS_STK *ptos, INT8U prio) reentrant
{
    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, ppdata, 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.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人的网站免费观看| 亚洲一区二区三区不卡国产欧美| 蜜桃免费网站一区二区三区| 在线观看亚洲成人| 亚洲成a人v欧美综合天堂下载| 精品视频全国免费看| 水野朝阳av一区二区三区| 91精品国产日韩91久久久久久| 日韩制服丝袜av| 日韩精品一区二区三区三区免费| 狠狠色综合日日| 国产精品麻豆一区二区| 欧美亚洲综合色| 精品一区二区三区久久| 国产精品美女www爽爽爽| 欧美综合视频在线观看| 日本在线不卡视频| 国产免费成人在线视频| 91成人看片片| 精品一区二区三区的国产在线播放| 国产婷婷色一区二区三区| 色婷婷综合久久久久中文| 肉肉av福利一精品导航| 久久色中文字幕| 在线观看视频一区二区欧美日韩| 日韩成人午夜精品| 国产精品久99| 欧美一区二区三区婷婷月色 | 亚洲国产美国国产综合一区二区| 91麻豆精品91久久久久久清纯| 欧美日韩免费视频| 亚洲chinese男男1069| 久久精品一区二区三区四区| 欧美艳星brazzers| 国产一区二区美女| 夜夜爽夜夜爽精品视频| 精品成人免费观看| 91国产免费观看| 国产精品自拍一区| 五月天久久比比资源色| 国产精品色婷婷| 精品欧美一区二区三区精品久久| 94-欧美-setu| 国精品**一区二区三区在线蜜桃| 亚洲欧美日本韩国| 国产三级一区二区| 欧美一区二区不卡视频| 日本久久电影网| 成人免费va视频| 久久99久久久欧美国产| 亚洲制服欧美中文字幕中文字幕| 国产午夜亚洲精品羞羞网站| 欧美一区二区视频免费观看| 日本丰满少妇一区二区三区| 成人午夜激情影院| 久久97超碰色| 日韩成人一级大片| 亚洲成人激情综合网| 日韩毛片在线免费观看| 欧美激情一区不卡| 国产人成一区二区三区影院| 日韩欧美中文字幕制服| 欧美日韩大陆一区二区| 欧美在线制服丝袜| 在线观看91精品国产入口| 99热99精品| 99久久婷婷国产综合精品电影| 福利一区福利二区| 国产精品影视网| 国产麻豆精品theporn| 精品一区二区三区在线视频| 蜜臀精品久久久久久蜜臀 | 国产女主播在线一区二区| 精品久久人人做人人爰| 日韩免费电影一区| 欧美第一区第二区| 久久综合狠狠综合久久综合88| 日韩一级免费观看| 精品国产污网站| 久久久一区二区三区捆绑**| 欧美精品一区二区三区视频| 欧美tickling挠脚心丨vk| 亚洲精品一区二区三区福利 | 国产午夜三级一区二区三| 久久综合色婷婷| 久久精品欧美一区二区三区不卡| 国产日韩综合av| 国产精品久久久久影视| 亚洲视频电影在线| 亚洲自拍偷拍综合| 三级不卡在线观看| 国内精品久久久久影院一蜜桃| 国产真实乱偷精品视频免| 国产一区二区网址| 成人国产电影网| 日本电影欧美片| 欧美挠脚心视频网站| 91精品国产色综合久久不卡电影| 日韩欧美在线不卡| 国产三级精品在线| 夜夜嗨av一区二区三区中文字幕| 五月婷婷欧美视频| 国产一区二区电影| 91小视频在线| 91精品婷婷国产综合久久性色 | 欧美剧情电影在线观看完整版免费励志电影 | 99久久精品99国产精品| 欧美综合久久久| 制服丝袜亚洲网站| 亚洲国产成人午夜在线一区| 亚洲美女少妇撒尿| 另类小说色综合网站| 懂色av一区二区三区免费看| 91视频一区二区| 日韩欧美一区二区久久婷婷| 中日韩免费视频中文字幕| 一区二区三区自拍| 极品少妇xxxx精品少妇| 99精品视频在线播放观看| 欧美优质美女网站| 国产三级久久久| 日本欧美韩国一区三区| 99re在线视频这里只有精品| 欧美一区二区三区四区久久| 国产精品久久综合| 蜜桃精品视频在线| 99久久久国产精品免费蜜臀| 日韩欧美电影一二三| 亚洲精品乱码久久久久| 国产一区视频导航| 欧美片网站yy| |精品福利一区二区三区| 另类人妖一区二区av| 欧洲激情一区二区| 国产精品妹子av| 韩国女主播一区| 91麻豆精品国产91久久久使用方法 | 在线观看视频一区| 中文字幕av一区二区三区| 日日夜夜精品视频天天综合网| 成人免费的视频| 精品国产凹凸成av人网站| 亚洲成年人影院| 色婷婷精品大视频在线蜜桃视频| 久久精品日产第一区二区三区高清版 | 精品国产一二三区| 亚洲大型综合色站| 日本韩国一区二区三区视频| 中文av一区特黄| 国产乱国产乱300精品| 日韩美女视频在线| 人人精品人人爱| 91精品黄色片免费大全| 亚洲国产毛片aaaaa无费看| 色丁香久综合在线久综合在线观看| 国产精品欧美久久久久无广告| 国内成人自拍视频| 精品国产乱码久久| 久久超碰97中文字幕| 欧美一级免费大片| 三级欧美在线一区| 777奇米成人网| 视频在线观看一区| 7777精品伊人久久久大香线蕉 | 国产精品白丝av| wwwwxxxxx欧美| 精品亚洲国内自在自线福利| 日韩一区二区三区电影在线观看| 视频一区欧美精品| 日韩一区二区视频| 国模冰冰炮一区二区| 国产欧美日本一区二区三区| 国产91在线看| 亚洲欧美色图小说| 欧美少妇一区二区| 三级一区在线视频先锋| 欧美一级日韩免费不卡| 黑人巨大精品欧美黑白配亚洲| 精品女同一区二区| 成人午夜电影小说| 亚洲精品中文在线| 欧美日韩国产高清一区二区三区| 天天av天天翘天天综合网色鬼国产| 91精品国产福利| 国产乱对白刺激视频不卡| 中文字幕第一区综合| 一本到不卡精品视频在线观看| 亚洲国产欧美另类丝袜| 欧美变态口味重另类| 国产jizzjizz一区二区| 亚洲女性喷水在线观看一区| 欧美性猛片aaaaaaa做受| 日本不卡在线视频| 欧美国产日韩在线观看| 91丨porny丨在线| 午夜精品一区二区三区电影天堂 | 久久av老司机精品网站导航| 国产精品久久影院| 欧美精品在线一区二区三区| 国产一区二区三区在线观看免费视频 |