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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? os_task.c

?? UCOS-II移植C8051單片機(jī)上 使用C8051F020開(kāi)發(fā)板。KEIL U3編譯通過(guò)。 串口連接到PC機(jī)上
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/*
*********************************************************************************************************
*                                                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) 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.

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久综合色天天久久综合图片| 丝瓜av网站精品一区二区 | 专区另类欧美日韩| 亚洲日本在线天堂| 一区二区三区四区在线| 久久九九全国免费| 久久精品夜色噜噜亚洲aⅴ| 国产欧美一区二区在线| 中文字幕亚洲欧美在线不卡| 国产精品久久久久永久免费观看| 中文字幕在线观看一区二区| 亚洲欧美日韩国产综合在线| 亚洲女同一区二区| 日韩精品三区四区| 国产精品一二三在| 国产专区欧美精品| 成人成人成人在线视频| 99re8在线精品视频免费播放| 粉嫩高潮美女一区二区三区| 日本不卡一二三| 理论片日本一区| 免费在线一区观看| 看电视剧不卡顿的网站| 日欧美一区二区| 亚洲国产色一区| 日韩不卡免费视频| 久久精品国产澳门| 久久成人综合网| 久久国产精品99精品国产| 国产成人在线视频网站| thepron国产精品| 欧洲精品在线观看| 欧美一级日韩免费不卡| 久久久欧美精品sm网站 | 亚洲视频精选在线| 欧美一区二区三区播放老司机| 精东粉嫩av免费一区二区三区| 国产·精品毛片| 欧美女孩性生活视频| 国产偷v国产偷v亚洲高清| 亚洲精品国产精华液| 三级欧美在线一区| 99久久免费精品| 日韩欧美视频在线| 亚洲精品免费播放| 国产精品一区二区黑丝| 91丨porny丨国产入口| www激情久久| 午夜精品福利一区二区三区蜜桃| 大陆成人av片| 精品日产卡一卡二卡麻豆| 亚洲精品国产第一综合99久久| 国内精品国产成人国产三级粉色| 欧美日韩午夜精品| 自拍av一区二区三区| 国产在线视频一区二区三区| 欧美日韩视频在线第一区 | 久久美女艺术照精彩视频福利播放| 一区二区三区在线免费视频| 丁香网亚洲国际| 久久久久国产成人精品亚洲午夜| 亚洲第四色夜色| 99re视频精品| 国产精品毛片久久久久久| 午夜欧美在线一二页| 色噜噜狠狠成人网p站| 国产欧美精品区一区二区三区| 美女性感视频久久| 欧美人狂配大交3d怪物一区| 一区二区三区在线播| av电影天堂一区二区在线观看| 337p日本欧洲亚洲大胆色噜噜| 日韩av在线发布| 欧美日韩dvd在线观看| 亚洲乱码国产乱码精品精的特点 | 蜜臀av性久久久久蜜臀aⅴ流畅| 大桥未久av一区二区三区中文| 欧美精品一区二区在线播放| 免费看欧美美女黄的网站| 欧美男女性生活在线直播观看| 亚洲激情欧美激情| 99国产一区二区三精品乱码| 中文成人综合网| 精品在线一区二区三区| 日韩精品一区二区三区四区| 美女视频黄免费的久久| 91精品国产麻豆国产自产在线 | 日韩免费福利电影在线观看| 激情欧美一区二区| 国产色91在线| 91麻豆产精品久久久久久| 一区二区三区四区视频精品免费| 欧美日韩三级一区二区| 日本在线不卡视频| 日韩精品一区二区三区老鸭窝| 男人操女人的视频在线观看欧美| 日韩欧美国产成人一区二区| 国产jizzjizz一区二区| 综合久久久久久久| 欧美色综合天天久久综合精品| 日韩福利视频网| 久久亚洲综合色| jizz一区二区| 日韩有码一区二区三区| 久久男人中文字幕资源站| 国产高清久久久| 国产精品久久久久久久久久久免费看| 成人性视频网站| 亚洲日本成人在线观看| 国产伦理精品不卡| 国产日韩视频一区二区三区| 成人aa视频在线观看| 亚洲人一二三区| 欧美日韩日日摸| 六月丁香婷婷久久| 国产欧美日韩亚州综合| 91视频免费播放| 午夜天堂影视香蕉久久| 欧美一二区视频| 国产精品123| 亚洲精品视频一区二区| 欧美亚洲精品一区| 人人爽香蕉精品| 亚洲欧洲日产国码二区| 777欧美精品| eeuss鲁片一区二区三区在线看| 亚洲成人777| 国产欧美日韩三级| 欧美日韩成人一区二区| 成人黄色a**站在线观看| 亚洲成人一区二区| 欧美国产亚洲另类动漫| 欧美男男青年gay1069videost | 亚洲欧美色综合| 久久在线观看免费| 欧美丝袜丝交足nylons图片| 精品在线亚洲视频| 亚洲丰满少妇videoshd| 国产精品五月天| 日韩欧美一二三四区| 色综合天天在线| 777奇米成人网| 国产99久久久久久免费看农村| 午夜精品久久久久久久久| 国产精品久久久久四虎| 欧美一级欧美三级| 在线观看av一区二区| 成人免费毛片a| 国内精品免费**视频| 五月婷婷久久综合| 一区二区在线观看视频在线观看| 国产亚洲一区字幕| 日韩精品一区二区三区swag| 欧美性极品少妇| 91视频com| 成人国产电影网| 国产精品18久久久久久vr| 日韩在线一二三区| 一区二区三区日韩欧美| 国产精品日产欧美久久久久| 2023国产精品| 日韩一级欧美一级| 欧美色图免费看| 91黄视频在线观看| 99久久免费视频.com| 成人视屏免费看| 国产福利不卡视频| 麻豆精品视频在线观看| 五月婷婷欧美视频| 午夜日韩在线电影| 亚洲第一av色| 午夜久久久影院| 午夜精品国产更新| 亚洲电影一级片| 调教+趴+乳夹+国产+精品| 亚洲成人高清在线| 性做久久久久久久久| 午夜精品一区二区三区免费视频 | 精品视频一区二区三区免费| 亚洲欧洲美洲综合色网| 国产日产欧美精品一区二区三区| 2023国产一二三区日本精品2022| 日韩精品在线网站| 欧美tickling网站挠脚心| 日韩欧美高清一区| 精品国产凹凸成av人网站| 日韩美女天天操| 久久综合色婷婷| 国产欧美日韩视频在线观看| 国产欧美日本一区视频| 国产精品色一区二区三区| 中国色在线观看另类| 国产蜜臀97一区二区三区| 国产欧美日韩激情| 成人欧美一区二区三区| 亚洲欧美偷拍三级| 亚洲香蕉伊在人在线观| 亚洲bt欧美bt精品| 久久国产精品区| 粗大黑人巨茎大战欧美成人|