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

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

?? os_task.c

?? uCOS_II在51單片機(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   DT_XDATA *ptcb;
    OS_EVENT DT_XDATA *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 DT_XDATA *)0) {                 /* New priority must not already exist */
        OS_EXIT_CRITICAL();
        return (OS_PRIO_EXIST);
    } else {
        OSTCBPrioTbl[newprio] = (OS_TCB DT_XDATA *)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 DT_XDATA *)0) {    /* Task to change must exist           */
            OSTCBPrioTbl[oldprio] = (OS_TCB DT_XDATA *)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 DT_XDATA *)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 DT_XDATA *)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
*
*              ppdata    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 'ppdata' as follows:
*
*                           void Task (void *ppdata)
*                           {
*                               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 (DT_CODE *task)(void DT_XDATA *pd), void DT_XDATA *ppdata, OS_STK DT_XDATA *ptos, INT8U prio) REENTRANT
{
    void DT_XDATA *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 DT_XDATA *)0) { /* Make sure task doesn't already exist at this priority  */
        OSTCBPrioTbl[prio] = (OS_TCB DT_XDATA *)1;    /* Reserve the priority to prevent others from doing ...  */
                                             /* ... the same thing until task is created.              */
        OS_EXIT_CRITICAL();
        psp = (void DT_XDATA *)OSTaskStkInit(task, ppdata, ptos, 0); /* Initialize the task's stack              */
        err = OSTCBInit(prio, psp, (void DT_XDATA *)0, 0, 0, (void DT_XDATA *)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 DT_XDATA *)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
*
*              ppdata    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 'ppdata' as follows:
*
*                           void Task (void *ppdata)
*                           {
*                               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一区二区三区免费野_久草精品视频
国产剧情一区二区| 国产精品亚洲午夜一区二区三区| 精品国产区一区| 日韩精品专区在线| 日韩欧美一级精品久久| 在线电影一区二区三区| 欧美日韩国产综合久久| 欧美日韩国产天堂| 欧美va在线播放| 久久你懂得1024| 欧美高清在线精品一区| 亚洲色图20p| 亚洲成人第一页| 日本伊人色综合网| 久久精品国产亚洲5555| 成人性生交大合| 一本大道久久a久久精品综合| 欧美视频自拍偷拍| av成人免费在线| 日一区二区三区| 性久久久久久久久| 天使萌一区二区三区免费观看| 中文字幕中文字幕中文字幕亚洲无线 | 日韩一区二区视频| 欧美一级一级性生活免费录像| 日韩一区二区在线观看视频播放| 色婷婷综合视频在线观看| 欧美日韩dvd在线观看| 日韩一级大片在线观看| 国产欧美va欧美不卡在线| 亚洲老妇xxxxxx| 麻豆国产91在线播放| 成人aa视频在线观看| 欧美午夜一区二区三区| 色嗨嗨av一区二区三区| 91精品一区二区三区久久久久久 | 国内精品写真在线观看| 成人综合婷婷国产精品久久| 欧美亚洲自拍偷拍| 久久九九久久九九| 亚洲综合一区二区精品导航| 玖玖九九国产精品| 色哟哟一区二区| 日韩精品在线看片z| 国产女人18水真多18精品一级做| 国产精品久久久久影院色老大| 成人免费一区二区三区视频| 美女网站一区二区| 国产91清纯白嫩初高中在线观看| 7777精品伊人久久久大香线蕉超级流畅| 久久久综合激的五月天| 日韩有码一区二区三区| 国产日产欧美精品一区二区三区| 1区2区3区欧美| 美日韩黄色大片| 91在线视频18| 国产欧美一区二区三区沐欲 | 美女免费视频一区| 91精品办公室少妇高潮对白| 国产欧美一区二区三区鸳鸯浴| 国产精品美女久久久久久久久 | 中文字幕av一区二区三区高 | 99麻豆久久久国产精品免费| 精品区一区二区| 图片区日韩欧美亚洲| 日本黄色一区二区| 国产精品丝袜一区| 激情综合网av| 欧美电影免费观看高清完整版 | 美女www一区二区| 555www色欧美视频| 亚洲成人资源在线| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 国产高清在线精品| 日韩欧美不卡一区| 久久国产精品99久久久久久老狼| 欧美片网站yy| 亚洲精品国久久99热| 99精品视频在线免费观看| 欧美国产综合一区二区| 成人免费看的视频| 国产精品久久影院| av在线不卡免费看| 久久久久久久久久看片| 国产一区二区三区久久悠悠色av| 精品久久久久久最新网址| 久久黄色级2电影| 欧美大片在线观看| 国产黄色91视频| 中文字幕亚洲综合久久菠萝蜜| av中文字幕不卡| 亚洲激情第一区| 91色.com| 日韩成人dvd| 2021中文字幕一区亚洲| 国产精品一区二区不卡| 国产精品蜜臀在线观看| 95精品视频在线| 国产精品美女视频| 欧美三级韩国三级日本三斤| 日韩精品一二三四| 欧美精品一区二区三区在线| 久久精品国产77777蜜臀| 国产日本欧美一区二区| 色婷婷综合五月| 老司机精品视频线观看86| 精品国产一区二区精华| 97精品超碰一区二区三区| 亚洲1区2区3区4区| 日韩欧美黄色影院| 99久久伊人久久99| 免费在线观看一区| 欧美国产禁国产网站cc| 在线观看视频一区| 丝袜诱惑制服诱惑色一区在线观看 | 日韩免费一区二区| 成人高清伦理免费影院在线观看| 一区二区三区日韩欧美| 久久久久久影视| 欧美视频一区二区在线观看| 久久99日本精品| 一区二区三区四区不卡在线 | 成人综合婷婷国产精品久久免费| 亚洲免费成人av| 国产亚洲视频系列| 欧美精品三级在线观看| 成年人国产精品| 激情深爱一区二区| 一区二区在线观看视频| 亚洲精品在线网站| 欧美一二三区在线观看| 91在线精品秘密一区二区| 男人的j进女人的j一区| 亚洲狼人国产精品| 国产精品国产a| 国产欧美日韩另类一区| aaa欧美日韩| 国产91精品一区二区| 国产精品久久久久久久浪潮网站| 欧美日韩三级视频| 欧美在线999| 91免费观看视频| 成人免费视频视频| 蜜桃视频在线观看一区| 亚洲视频综合在线| 国产欧美日韩另类一区| 欧美大肚乱孕交hd孕妇| 欧美另类z0zxhd电影| 欧美亚洲日本国产| 在线免费观看一区| 99久久久久免费精品国产| 不卡av免费在线观看| 成人做爰69片免费看网站| 国产精选一区二区三区| 国产永久精品大片wwwapp| 免费亚洲电影在线| 青青草原综合久久大伊人精品 | 欧美日韩中字一区| 欧美日韩精品电影| 欧美性受极品xxxx喷水| 精品视频一区二区不卡| 国产一区91精品张津瑜| 视频一区二区欧美| 亚洲久草在线视频| 91精品国产色综合久久久蜜香臀| 大胆亚洲人体视频| 精品一区二区三区视频在线观看| 精品奇米国产一区二区三区| 日本精品裸体写真集在线观看| 五月天丁香久久| 日本不卡一区二区| 亚洲亚洲人成综合网络| 欧美日韩一区久久| 日韩视频一区二区三区| av在线这里只有精品| 欧美日免费三级在线| 欧美亚洲自拍偷拍| 精品国产凹凸成av人导航| 日韩亚洲欧美一区二区三区| 国产区在线观看成人精品| 国产香蕉久久精品综合网| 国产自产视频一区二区三区| 国产一区 二区| 国产大陆亚洲精品国产| 一本在线高清不卡dvd| 不卡av电影在线播放| 欧美精品精品一区| 6080日韩午夜伦伦午夜伦| 日韩一级片网站| 久久色在线视频| 欧美国产日本韩| 国产精品国产自产拍高清av王其| 久久久久久久久久久久久夜| 亚洲欧美激情一区二区| 亚洲国产一区二区视频| 久久99久久99| 国产成人午夜精品影院观看视频| 国产99精品国产| 99在线视频精品| 日本高清免费不卡视频|