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

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

?? 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.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
婷婷夜色潮精品综合在线| 国产亚洲精品精华液| 亚洲人被黑人高潮完整版| 国产suv精品一区二区三区| 久久久久久久性| 国产精品一区一区| 最新久久zyz资源站| 色综合一个色综合| 亚洲h在线观看| 欧美va亚洲va在线观看蝴蝶网| 国产精品亚洲一区二区三区妖精| 国产亚洲欧洲997久久综合| 成人激情文学综合网| 亚洲同性gay激情无套| 欧美高清一级片在线| 经典三级视频一区| 国产精品私人自拍| 日本高清成人免费播放| 男女性色大片免费观看一区二区 | 色噜噜久久综合| 亚洲伊人伊色伊影伊综合网| 欧美一区二区久久| 国产成人免费视频网站| 亚洲男人的天堂在线观看| 欧美一级欧美三级在线观看| 福利一区二区在线| 视频一区二区三区中文字幕| 国产精品无圣光一区二区| 欧美在线999| 国产一区二区在线免费观看| 亚洲精品高清在线| 精品处破学生在线二十三| 色婷婷精品久久二区二区蜜臀av| 青青草91视频| 中文字幕一区二区三区在线不卡| 在线91免费看| 91在线免费播放| 国产一区二区免费在线| 亚洲综合丝袜美腿| 国产日韩亚洲欧美综合| 欧美精品九九99久久| 成人av网站免费观看| 美腿丝袜亚洲色图| 亚洲丶国产丶欧美一区二区三区| 久久久久久97三级| 欧美一区日本一区韩国一区| 91免费看`日韩一区二区| 国产麻豆视频精品| 天天色 色综合| 一区二区三区加勒比av| 国产精品天美传媒沈樵| 精品久久久久久久久久久久包黑料 | 五月婷婷激情综合网| 欧美国产精品v| 欧美精品一区二区久久久 | 欧美日韩国产不卡| 99久久久久久| 国v精品久久久网| 国产在线播放一区| 久久不见久久见中文字幕免费| 亚洲福利视频一区二区| 亚洲欧洲成人自拍| 国产精品三级在线观看| 久久亚洲精精品中文字幕早川悠里| 欧美喷潮久久久xxxxx| 在线观看日韩精品| 在线观看一区二区精品视频| 99久久综合狠狠综合久久| 国产成人av影院| 国产成人在线网站| 国产尤物一区二区在线| 久久国产免费看| 精品综合久久久久久8888| 日日夜夜一区二区| 日韩av高清在线观看| 天堂va蜜桃一区二区三区| 天堂精品中文字幕在线| 性欧美大战久久久久久久久| 亚洲影视在线播放| 五月天视频一区| 日本成人在线视频网站| 日本伊人色综合网| 久久精品99久久久| 国产资源在线一区| 成人永久aaa| 成人美女在线观看| av不卡在线观看| 色偷偷久久一区二区三区| 在线观看欧美日本| 6080日韩午夜伦伦午夜伦| 日韩三区在线观看| 久久久久久久久久久久久夜| 久久精品亚洲精品国产欧美 | 69精品人人人人| 日韩精品在线一区| 国产亚洲综合av| 亚洲色图在线播放| 爽爽淫人综合网网站| 狠狠狠色丁香婷婷综合激情 | 综合欧美一区二区三区| 亚洲精品免费在线播放| 天天操天天干天天综合网| 久久成人久久鬼色| 不卡一二三区首页| 在线播放中文字幕一区| 精品国产一区二区三区四区四 | 欧美电影一区二区| 久久亚洲影视婷婷| 国产精品久久久久久久久免费桃花| 亚洲美女免费在线| 91国内精品野花午夜精品| 欧美网站大全在线观看| 欧美成人激情免费网| 亚洲视频狠狠干| 美国毛片一区二区| av在线播放不卡| 91精品国产一区二区三区香蕉| 国产日韩欧美高清| 亚洲成人免费在线| 成人18视频在线播放| 欧美自拍偷拍一区| 久久久精品国产99久久精品芒果 | 午夜精品久久久久久久蜜桃app| 六月丁香综合在线视频| 99久久精品国产观看| 欧美精品99久久久**| 欧美国产日产图区| 日本不卡123| 91免费观看视频在线| 亚洲精品在线观| 午夜精品久久久久影视| 99久久精品久久久久久清纯| 欧美一级在线视频| 一区二区三区在线观看视频| 国产成人午夜精品影院观看视频 | 国产精品久久久久精k8| 热久久久久久久| 99久久精品国产一区二区三区| 日韩一卡二卡三卡四卡| 最近中文字幕一区二区三区| 久草这里只有精品视频| 欧美日韩国产系列| 综合久久久久综合| 国产精品主播直播| 日韩丝袜美女视频| 亚洲日本青草视频在线怡红院| 国产一区视频在线看| 欧美一区二区三区视频免费播放| 亚洲女性喷水在线观看一区| 懂色一区二区三区免费观看| 欧美精品一区二区久久久| 免费观看30秒视频久久| 精品视频在线视频| 亚洲激情在线播放| 91美女片黄在线| 国产精品素人视频| 成人在线综合网| 国产精品激情偷乱一区二区∴| 国产一区二区中文字幕| 欧美精品一区二区三区四区| 捆绑变态av一区二区三区| 欧美丰满美乳xxx高潮www| 亚洲综合丝袜美腿| 在线免费观看日韩欧美| 亚洲精品中文字幕在线观看| 从欧美一区二区三区| 国产女同互慰高潮91漫画| 国产精品亚洲成人| 久久久国产午夜精品| 国产精品99久久久久久宅男| 久久精品人人做人人爽人人| 国产在线日韩欧美| 欧美激情一区在线观看| 99精品视频一区二区三区| 国产精品久久久久久亚洲毛片| 国产精品99精品久久免费| 国产性做久久久久久| 成人教育av在线| 亚洲日本电影在线| 91久久精品日日躁夜夜躁欧美| 一区二区三区精品视频在线| 欧美日韩精品免费观看视频| 日韩精品亚洲一区| 欧美精品一区二区精品网| 国产高清视频一区| 国产精品久久久久影视| 91极品视觉盛宴| 天天综合色天天综合色h| 精品久久久久久亚洲综合网| 国产高清精品网站| 亚洲欧美日韩成人高清在线一区| 在线免费av一区| 久久丁香综合五月国产三级网站| 久久久久久久久蜜桃| 成人黄动漫网站免费app| 一区二区在线电影| 精品乱码亚洲一区二区不卡| 不卡在线视频中文字幕| 午夜欧美2019年伦理| 久久精品亚洲麻豆av一区二区|