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

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

?? os_task.c

?? UCOS——FOR——UNSP2
?? 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_EN
INT8U 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_EN
INT8U 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一区二区三区免费野_久草精品视频
偷拍与自拍一区| 中文字幕欧美日韩一区| 91麻豆国产在线观看| 国产一级精品在线| 国产在线精品一区二区三区不卡| 日本欧美一区二区三区| 午夜欧美大尺度福利影院在线看| 亚洲乱码国产乱码精品精98午夜| 国产精品网站在线观看| 免费成人性网站| 婷婷丁香久久五月婷婷| 亚洲成av人片| 久久99九九99精品| 国产一区二区三区综合 | caoporn国产精品| 不卡欧美aaaaa| 一本一本大道香蕉久在线精品 | 欧美日韩免费视频| 欧美日韩在线精品一区二区三区激情 | 欧美三级在线视频| 欧美一区二区精品在线| 亚洲图片激情小说| 粉嫩绯色av一区二区在线观看| 九色porny丨国产精品| 国产一区不卡视频| av激情亚洲男人天堂| 91豆麻精品91久久久久久| 欧美日韩一本到| 日韩精品一区在线| 亚洲色图20p| 美女网站视频久久| 成人激情免费视频| 宅男噜噜噜66一区二区66| 久久综合色鬼综合色| 亚洲图片欧美激情| 蜜臂av日日欢夜夜爽一区| 成av人片一区二区| 日韩欧美一区二区免费| 亚洲色欲色欲www| 久久精品国产亚洲a| 一本久久精品一区二区| 久久精品一区二区三区不卡 | 国产精品中文字幕一区二区三区| 大胆亚洲人体视频| 日韩一级精品视频在线观看| 国产欧美一区二区精品性色超碰| 亚洲一区二区在线免费看| 国产在线精品视频| 欧美日本一区二区三区| 国产精品久久久久影院| 久久精品国产99| 欧美色精品在线视频| 国产欧美日韩在线| 麻豆传媒一区二区三区| 欧美在线免费观看亚洲| 中文字幕高清一区| 久久精品国产999大香线蕉| 欧美日韩视频在线第一区| 国产精品久久久久天堂| 国产精品系列在线观看| 日韩一级精品视频在线观看| 亚洲一区在线电影| 色综合久久精品| 中文字幕永久在线不卡| 国产成人免费视频一区| 久久一区二区视频| 狠狠色丁香婷婷综合久久片| 884aa四虎影成人精品一区| 亚洲一区二区av在线| 91视频91自| 一区二区三区小说| 色偷偷一区二区三区| 亚洲日本在线a| 99久久综合99久久综合网站| 天堂资源在线中文精品| 色老汉一区二区三区| 亚洲天堂a在线| 三级影片在线观看欧美日韩一区二区 | 日韩美女视频在线| 午夜电影一区二区三区| 在线观看成人免费视频| 亚洲精品国产高清久久伦理二区| 91视频免费播放| 一区二区三区欧美久久| 欧亚一区二区三区| 天堂资源在线中文精品| 欧美日韩精品一区二区三区| 午夜欧美大尺度福利影院在线看| 欧美三级在线播放| 毛片一区二区三区| 久久久天堂av| jvid福利写真一区二区三区| 一区二区三区日本| 欧美日韩一级黄| 美国毛片一区二区三区| 国产女人aaa级久久久级| 91一区二区三区在线观看| 一区二区三区在线观看国产| 欧美二区在线观看| 国产一区 二区 三区一级| 日本高清不卡aⅴ免费网站| 中文字幕av在线一区二区三区| 国产精品一区二区91| 中文字幕一区二区三| 欧美日韩电影在线播放| 久久精品理论片| 国产精品久久久久永久免费观看| 欧美在线你懂的| 国产伦精品一区二区三区免费 | 99精品欧美一区二区三区小说| 最新欧美精品一区二区三区| 欧美色综合网站| 国产精品99久| 视频一区视频二区在线观看| 久久亚洲捆绑美女| 欧美在线免费观看亚洲| 亚洲蜜臀av乱码久久精品蜜桃| 欧美视频三区在线播放| 国产精品一区二区你懂的| 亚洲色图欧美在线| 日韩欧美久久一区| 一本色道综合亚洲| 国产精品1区2区3区在线观看| 亚洲制服丝袜av| 日本一区二区三区dvd视频在线| 91成人在线免费观看| 国产精品一色哟哟哟| 五月婷婷欧美视频| 成人免费在线视频| 久久亚洲精华国产精华液| 欧美裸体bbwbbwbbw| 91在线免费播放| 国产精品夜夜嗨| 六月婷婷色综合| 无码av免费一区二区三区试看 | 亚洲成人黄色小说| 中文字幕五月欧美| 国产日韩高清在线| 国产一区二区三区免费| 91精品国产丝袜白色高跟鞋| 成人亚洲精品久久久久软件| 日韩中文字幕一区二区三区| 中文字幕日韩欧美一区二区三区| 日韩欧美亚洲一区二区| 欧美电影在哪看比较好| 欧美专区亚洲专区| 欧美午夜不卡视频| 日本丰满少妇一区二区三区| 不卡的看片网站| 白白色 亚洲乱淫| www.亚洲人| 不卡的av中国片| 91免费在线播放| 色综合久久九月婷婷色综合| 99vv1com这只有精品| 91美女在线视频| 欧洲精品中文字幕| 欧美精品丝袜久久久中文字幕| 欧美专区日韩专区| 欧美精选午夜久久久乱码6080| 欧美亚州韩日在线看免费版国语版| 99精品视频一区二区三区| 99re这里只有精品6| 色视频一区二区| 欧美剧情电影在线观看完整版免费励志电影 | 99re6这里只有精品视频在线观看| 国产一区二区精品久久99| 国产超碰在线一区| 99久久免费视频.com| 欧美在线视频日韩| 欧美一区二区三区男人的天堂| 日韩美女主播在线视频一区二区三区| 日韩欧美另类在线| 国产欧美日韩视频一区二区 | 日本精品视频一区二区| 欧美影视一区在线| 精品国免费一区二区三区| 亚洲国产成人午夜在线一区| 亚洲日本va午夜在线影院| 亚洲午夜影视影院在线观看| 爽好久久久欧美精品| 精品一区二区影视| 99久久精品国产毛片| 欧美日本在线视频| 久久精品亚洲麻豆av一区二区| 日韩一区在线看| 蜜桃视频在线观看一区| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 免费的国产精品| 成人av电影免费观看| 一区二区三区av电影| 亚洲高清视频在线| 精品一区免费av| 在线看国产一区二区| 久久久亚洲精华液精华液精华液| 亚洲欧美国产毛片在线| 久久99国产精品成人| 日本国产一区二区| 国产目拍亚洲精品99久久精品| 一区二区成人在线观看|