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

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

?? os_task.c

?? ucos系統
?? 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) 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一区二区三区免费野_久草精品视频
91精品国产综合久久福利软件 | 欧美国产国产综合| 欧美一区二区三区公司| 欧美日韩精品一区二区天天拍小说 | 欧美精品第一页| 欧美日韩高清一区| 欧美福利一区二区| 欧美mv日韩mv国产网站app| 精品捆绑美女sm三区| 精品国产凹凸成av人导航| 久久综合资源网| 国产午夜亚洲精品理论片色戒 | 中文字幕视频一区| 欧美日本乱大交xxxxx| 欧美精品欧美精品系列| 日韩一二三四区| 精品国产麻豆免费人成网站| 精品成a人在线观看| 国产欧美一区二区在线观看| 中文字幕一区二区三区四区不卡| 亚洲视频你懂的| 日韩电影一区二区三区四区| 亚洲伦在线观看| 九九九久久久精品| 国产一区二区在线免费观看| 国产精品一二一区| 99国产精品久久久久| 欧美午夜宅男影院| 日韩欧美中文一区| 国产亚洲成av人在线观看导航| 国产精品天美传媒| 亚洲妇女屁股眼交7| 久久超级碰视频| 成人精品亚洲人成在线| 欧美视频中文一区二区三区在线观看| 7777精品久久久大香线蕉| 亚洲精品在线免费播放| 国产精品久久久久久久久图文区 | 亚洲国产精品ⅴa在线观看| 亚洲日本欧美天堂| 久久国产综合精品| 国产高清无密码一区二区三区| 色婷婷一区二区| 精品国产一区二区三区av性色| 日韩一区在线看| 日韩中文字幕区一区有砖一区| 国产精品91xxx| 欧美午夜精品一区二区蜜桃| ww亚洲ww在线观看国产| 亚洲尤物在线视频观看| 国产伦精品一区二区三区在线观看 | 韩国一区二区三区| 色综合色综合色综合色综合色综合| 日韩一卡二卡三卡| 亚洲理论在线观看| 国产高清精品网站| 在线播放中文字幕一区| 中文字幕欧美激情一区| 日本最新不卡在线| 色悠悠亚洲一区二区| 国产二区国产一区在线观看| 91啪亚洲精品| 久久久亚洲综合| 亚洲高清视频中文字幕| 成人av中文字幕| 日韩限制级电影在线观看| 中文字幕一区二区在线播放| 久久机这里只有精品| 日本成人在线视频网站| 成人免费视频一区| 日韩美女主播在线视频一区二区三区 | 亚洲色图制服诱惑 | 国产福利一区二区三区| 日韩一级大片在线| 午夜精品福利一区二区三区av| 成人妖精视频yjsp地址| 精品国产乱码久久久久久浪潮 | 色综合咪咪久久| 欧美国产一区二区在线观看| 久久激情五月婷婷| 91精品国产色综合久久不卡蜜臀| 亚洲永久精品国产| 色综合久久88色综合天天6| 亚洲sss视频在线视频| 国产精品网曝门| 精品在线播放免费| 欧美日韩色一区| 亚洲国产精品久久久久婷婷884 | 国产一区二区成人久久免费影院| 91精品国产综合久久福利软件| 亚洲国产精品嫩草影院| 在线这里只有精品| 亚洲精品国产品国语在线app| 成人av小说网| 国产精品久久综合| 99精品欧美一区二区蜜桃免费 | 最新日韩av在线| 成人av电影在线观看| 中文字幕不卡的av| 成人性生交大片免费看在线播放| 国产日韩三级在线| 国产69精品久久久久毛片| 国产日韩亚洲欧美综合| 成人高清视频免费观看| 亚洲欧美在线观看| 久久你懂得1024| 欧美无砖专区一中文字| 亚洲乱码中文字幕| 97久久人人超碰| 亚洲色图在线视频| 色av一区二区| 亚洲超碰精品一区二区| 91精品国产品国语在线不卡| 午夜欧美2019年伦理| 日韩精品一二三区| 日韩一级精品视频在线观看| 蜜桃av噜噜一区二区三区小说| 日韩无一区二区| 国产一区二区三区免费观看| 日本一区二区高清| 一本大道av伊人久久综合| 亚洲成人免费视频| 日韩写真欧美这视频| 国产高清在线观看免费不卡| 国产精品久久久久久久久久久免费看 | 亚洲精品日产精品乱码不卡| 欧美日韩在线免费视频| 麻豆中文一区二区| 国产欧美日韩精品在线| 色乱码一区二区三区88| 天天色天天操综合| 久久久欧美精品sm网站| 91原创在线视频| 视频一区中文字幕国产| 欧美亚日韩国产aⅴ精品中极品| 亚洲精品乱码久久久久久久久| 在线看日韩精品电影| 日韩成人午夜电影| 欧美激情一区二区三区不卡 | 精品国产一区二区亚洲人成毛片| 国产精品中文字幕一区二区三区| 中文字幕亚洲一区二区av在线 | 欧美色爱综合网| 麻豆成人91精品二区三区| 国产精品成人午夜| 日韩视频免费观看高清完整版在线观看| 国产福利精品一区二区| 亚洲va韩国va欧美va| 国产一区激情在线| 亚洲女与黑人做爰| 日韩欧美中文字幕精品| 91网站视频在线观看| 麻豆成人久久精品二区三区红| **欧美大码日韩| 欧美变态tickle挠乳网站| 91老师片黄在线观看| 精品制服美女久久| 久久久久久久久久久黄色| 国产99久久久久| 水蜜桃久久夜色精品一区的特点 | 亚洲综合另类小说| 精品国产污污免费网站入口 | 欧美亚洲日本国产| 国产一区二区三区四| 午夜婷婷国产麻豆精品| 国产精品欧美久久久久无广告 | 免费观看在线综合| 一区二区不卡在线视频 午夜欧美不卡在| 欧美xingq一区二区| 欧美在线免费播放| 不卡电影免费在线播放一区| 蜜臀av一级做a爰片久久| 一区二区在线观看视频在线观看| 久久综合成人精品亚洲另类欧美| 欧美丝袜第三区| 91免费观看在线| 成人免费看片app下载| 久久超碰97中文字幕| 性久久久久久久久| 亚洲人成精品久久久久久 | 美女高潮久久久| 亚洲一区二区av在线| 麻豆国产精品777777在线| 99国产精品一区| 国产高清在线精品| 经典一区二区三区| 青青草国产精品亚洲专区无| 亚洲午夜在线电影| 亚洲三级理论片| 亚洲欧美怡红院| 国产精品你懂的在线| 国产精品三级电影| 国产欧美日韩在线| 国产欧美va欧美不卡在线| 久久尤物电影视频在线观看| 精品久久国产字幕高潮| 日韩一区二区电影在线| 日韩欧美一级二级三级久久久| 欧美精品粉嫩高潮一区二区| 欧美男人的天堂一二区|