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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? os_task.c

?? 在Keil C環(huán)境下運行的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);

/*
*********************************************************************************************************
*                                            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) TASK_REENTRANT, void *pdata, OS_STK *ptos, INT8U prio) KCREENTRANT
{
    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.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久久久久久电影| 日本午夜精品视频在线观看| 亚洲精品亚洲人成人网在线播放| 三级欧美在线一区| 国产经典欧美精品| 91精品国产91热久久久做人人| 国产精品动漫网站| 国产精品影视天天线| 欧美日韩精品二区第二页| 国产精品午夜在线观看| 麻豆中文一区二区| 欧美日韩国产影片| 亚洲影视在线播放| 成人精品亚洲人成在线| 日韩亚洲欧美综合| 婷婷夜色潮精品综合在线| 色哟哟一区二区| ㊣最新国产の精品bt伙计久久| 国产麻豆成人精品| 欧美精品乱码久久久久久| 亚洲免费色视频| www.综合网.com| 欧美经典三级视频一区二区三区| 久久国产麻豆精品| 日韩精品综合一本久道在线视频| 亚洲成av人片www| 欧美亚洲动漫制服丝袜| 亚洲精品国产a久久久久久| 国产a视频精品免费观看| 久久精品综合网| 国产精品主播直播| 久久精品人人做人人爽人人| 久久成人麻豆午夜电影| 日韩午夜av电影| 久久精品国产秦先生| 欧美一级艳片视频免费观看| 调教+趴+乳夹+国产+精品| 欧美性猛交一区二区三区精品| 亚洲精品美国一| 欧美日韩三级一区| 日本sm残虐另类| 欧美刺激午夜性久久久久久久| 精品一区二区在线视频| 精品久久久久久无| 国产不卡一区视频| 中文字幕人成不卡一区| 欧洲日韩一区二区三区| 亚洲第一福利视频在线| 日韩你懂的电影在线观看| 久久国产欧美日韩精品| 日本一区二区动态图| 91在线丨porny丨国产| 亚洲高清视频的网址| 91麻豆精品国产无毒不卡在线观看| 另类调教123区| 日本一区二区三区高清不卡| 色综合天天性综合| 视频一区在线视频| 久久影音资源网| 97精品国产97久久久久久久久久久久| 亚洲理论在线观看| 欧美日韩精品欧美日韩精品| 美女脱光内衣内裤视频久久网站| 国产精品久久二区二区| 91网站黄www| 日韩精品亚洲专区| 亚洲国产激情av| 欧美日韩一区二区三区高清| 日本一不卡视频| 国产日韩精品一区二区三区| 色综合久久久久网| 日韩—二三区免费观看av| 国产亚洲午夜高清国产拍精品| 色婷婷久久综合| 国内久久精品视频| 一区二区三区丝袜| 久久精品亚洲乱码伦伦中文| 欧美日韩国产一级| 成人a区在线观看| 免费观看日韩av| 一区二区欧美国产| 国产视频一区二区在线观看| 777色狠狠一区二区三区| 国产成人h网站| 天堂在线亚洲视频| 亚洲视频一区二区免费在线观看| 91精品国产免费| 色综合天天狠狠| 高清不卡在线观看av| 蜜桃视频一区二区三区在线观看 | 一区二区三区国产精华| 精品日韩av一区二区| 欧美日韩在线播放三区四区| 粉嫩aⅴ一区二区三区四区五区| 日韩电影免费在线| 亚洲免费资源在线播放| 国产精品五月天| 久久久99久久| 日韩美女主播在线视频一区二区三区| 欧美性色aⅴ视频一区日韩精品| 成人aaaa免费全部观看| 国产一区二区三区免费| 蜜臀久久99精品久久久久宅男| 亚洲成人激情社区| 亚洲资源中文字幕| 一区二区三区精品| 一区二区三区在线观看动漫| 中文字幕中文字幕一区| 国产精品污网站| 国产精品久久久久婷婷二区次| 2023国产一二三区日本精品2022| 欧美一区二区三区的| 日韩一级二级三级精品视频| 91精品国产综合久久久蜜臀粉嫩 | 大胆亚洲人体视频| 国产最新精品精品你懂的| 精品一区二区成人精品| 久久不见久久见免费视频7| 男男gaygay亚洲| 美女www一区二区| 国内外精品视频| 国产高清在线精品| 不卡的电影网站| 99久久婷婷国产综合精品电影| 99久久精品一区二区| 色综合 综合色| 欧美日韩成人在线| 日韩网站在线看片你懂的| 精品国产乱码91久久久久久网站| 亚洲视频免费观看| 亚洲裸体xxx| 日日夜夜免费精品| 国产在线播精品第三| 东方欧美亚洲色图在线| 91免费看`日韩一区二区| 欧洲精品在线观看| 日韩亚洲欧美一区二区三区| 久久免费的精品国产v∧| ...av二区三区久久精品| 亚洲bt欧美bt精品| 麻豆极品一区二区三区| 成人黄页毛片网站| 在线观看不卡视频| 精品欧美一区二区久久| 中文字幕国产精品一区二区| 中文字幕在线观看一区| 婷婷久久综合九色国产成人| 国产在线精品国自产拍免费| 色综合色综合色综合色综合色综合 | 天天影视色香欲综合网老头| 精品一区二区免费视频| 91看片淫黄大片一级| 69久久夜色精品国产69蝌蚪网| ww亚洲ww在线观看国产| 一区二区三区精品久久久| 免费精品99久久国产综合精品| 不卡一区在线观看| 91精品国产品国语在线不卡| 国产精品久久久久久久久免费相片| 亚洲大型综合色站| 成人久久久精品乱码一区二区三区| 欧美日韩一卡二卡三卡| 国产精品久线在线观看| 欧美aaaaa成人免费观看视频| 99麻豆久久久国产精品免费| 日韩精品一区在线| 一区二区三区日韩精品| 国产精品综合久久| 欧美一区二区视频免费观看| 亚洲色图一区二区| 国产成人综合在线| 欧美一级二级在线观看| 亚洲一区二区三区在线| 不卡影院免费观看| 久久一区二区视频| 日本成人中文字幕| 在线免费观看一区| 中文字幕一区二区三区四区| 日韩电影免费在线看| 欧美天堂亚洲电影院在线播放| 日本一二三四高清不卡| 国产综合色在线| 欧美大片一区二区| 日韩电影免费在线看| 欧美三电影在线| 亚洲黄色尤物视频| 色狠狠一区二区三区香蕉| 久久久三级国产网站| 久久精品国产一区二区三区免费看 | 26uuu另类欧美| 日韩成人午夜精品| 欧美老年两性高潮| 亚洲国产欧美在线| 色天天综合久久久久综合片| 国产精品麻豆一区二区| 成人深夜视频在线观看| 亚洲国产精品激情在线观看| 福利电影一区二区| 亚洲国产成人私人影院tom| 成人小视频在线|