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

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

?? os_task.c

?? ucosii 在44B0X上的移植,調試通過,可以做為開發的參考.
?? 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一区二区三区免费野_久草精品视频
久久精品男人天堂av| 国产亚洲欧洲997久久综合 | 国产亚洲一本大道中文在线| 亚洲人妖av一区二区| 五月激情综合色| 大尺度一区二区| 欧美一级片在线看| 夜夜嗨av一区二区三区中文字幕| 国产一区久久久| 欧美一区二区三区公司| 亚洲综合久久久久| 99精品视频一区二区三区| 精品剧情v国产在线观看在线| 亚洲综合清纯丝袜自拍| 国产成人在线免费观看| 久久综合九色综合97婷婷女人 | 日本中文字幕不卡| 色婷婷国产精品| 亚洲欧洲美洲综合色网| 国产一区二区三区香蕉| 日韩一区二区免费在线电影| 天堂久久久久va久久久久| 一本色道**综合亚洲精品蜜桃冫| 2014亚洲片线观看视频免费| 免费观看在线综合| 91精品国产aⅴ一区二区| 亚洲综合自拍偷拍| 色网站国产精品| 国产精品伦理在线| 成人一区二区在线观看| 日韩精品一区二区三区在线播放| 肉丝袜脚交视频一区二区| 欧美在线小视频| 亚洲bt欧美bt精品| 欧美日韩一级视频| 日韩黄色免费电影| 亚洲精品在线网站| 国产精品中文字幕一区二区三区| 久久精品视频在线免费观看| 精品一二三四区| 久久亚洲综合色一区二区三区| 国产一区二区三区| 中文字幕不卡的av| 99精品黄色片免费大全| 亚洲人成精品久久久久久 | 日韩亚洲欧美中文三级| 免费人成在线不卡| 国产日产欧美一区二区视频| 波多野结衣在线aⅴ中文字幕不卡| 中文字幕av在线一区二区三区| 成人aa视频在线观看| 亚洲九九爱视频| 欧美三级电影网| 欧美aⅴ一区二区三区视频| 欧美白人最猛性xxxxx69交| 国产河南妇女毛片精品久久久 | 99热精品一区二区| 一个色妞综合视频在线观看| 777午夜精品视频在线播放| 国产一区二区美女诱惑| 综合欧美一区二区三区| 91精品国产色综合久久久蜜香臀| 国产一区激情在线| 亚洲欧美日韩一区二区三区在线观看| 欧洲在线/亚洲| 国产在线不卡一区| 夜夜亚洲天天久久| 精品入口麻豆88视频| 色偷偷成人一区二区三区91| 免费在线观看精品| 亚洲日本免费电影| 欧美一区二区啪啪| 91在线看国产| 精品一区中文字幕| 一区二区三区高清在线| 久久色视频免费观看| 欧美午夜精品免费| 成人午夜免费av| 免播放器亚洲一区| 亚洲一区二区三区小说| 久久久高清一区二区三区| 91福利国产成人精品照片| 国产精品一区二区免费不卡| 日韩在线卡一卡二| 亚洲三级理论片| 中文字幕第一区| 久久综合av免费| 欧美久久久久久蜜桃| 99视频精品在线| 国产一区二区免费看| 日本大胆欧美人术艺术动态| 亚洲欧美日韩一区二区| 中文字幕第一区二区| 久久综合九色综合97婷婷女人| 欧美日韩国产电影| 91福利视频在线| 色婷婷精品久久二区二区蜜臂av| 处破女av一区二区| 国产精品一区一区三区| 久久se精品一区精品二区| 天天爽夜夜爽夜夜爽精品视频| 亚洲欧美国产毛片在线| 国产精品久久久久影院色老大| 欧美精品一区在线观看| 欧美草草影院在线视频| 精品日产卡一卡二卡麻豆| 欧美一区二区三区免费在线看| 欧美日韩一区二区三区在线看| 日本韩国欧美一区二区三区| 97se亚洲国产综合自在线| 国产成人av一区| 国产精品一区二区x88av| 国产尤物一区二区| 国产一区二区成人久久免费影院| 老司机一区二区| 美女在线观看视频一区二区| 蜜臀av一区二区| 国内成+人亚洲+欧美+综合在线| 日本sm残虐另类| 日本在线不卡视频| 久国产精品韩国三级视频| 九一九一国产精品| 国产一区999| 丰满亚洲少妇av| 91在线观看视频| 欧美三级电影在线观看| 欧美片网站yy| 精品91自产拍在线观看一区| 久久久不卡网国产精品二区| 国产精品视频在线看| 亚洲三级电影全部在线观看高清| 亚洲卡通欧美制服中文| 三级在线观看一区二区| 裸体歌舞表演一区二区| 国产精品一色哟哟哟| 91丝袜美腿高跟国产极品老师 | 丝袜美腿亚洲一区| 蜜臀a∨国产成人精品| 国产成人av福利| 91亚洲男人天堂| 欧美肥妇毛茸茸| 国产午夜亚洲精品不卡| 亚洲欧美日韩综合aⅴ视频| 天天操天天色综合| 国产精品中文欧美| 在线一区二区三区四区五区 | 国产精品欧美极品| 亚洲一级二级三级在线免费观看| 免费成人在线观看| 99久久免费精品高清特色大片| 欧美精品日韩综合在线| 久久久久国产成人精品亚洲午夜| 亚洲免费观看高清完整版在线观看| 日韩激情一区二区| 91在线视频观看| 欧美变态口味重另类| 一区二区三区免费| 国产乱淫av一区二区三区 | 亚洲国产一区二区a毛片| 国产自产2019最新不卡| 91豆麻精品91久久久久久| www国产成人免费观看视频 深夜成人网 | 国产精品美日韩| 首页综合国产亚洲丝袜| 成人毛片在线观看| 欧美成人伊人久久综合网| 一区二区三区视频在线观看| 国产99久久久国产精品潘金网站| 欧美日韩激情在线| 亚洲男人的天堂av| 风间由美一区二区av101| 日韩欧美国产三级电影视频| 亚洲国产成人av| 一本色道久久综合狠狠躁的推荐 | 91精品午夜视频| 亚洲三级视频在线观看| 国产91精品久久久久久久网曝门| 欧美欧美欧美欧美首页| 一区二区三区欧美| av在线不卡观看免费观看| 久久久久88色偷偷免费| 韩国一区二区三区| 日韩欧美亚洲另类制服综合在线| 亚洲成人精品一区| 在线一区二区视频| 亚洲美女在线国产| 99精品在线观看视频| 亚洲国产精品黑人久久久| 国产在线精品免费| 日韩免费高清av| 老司机午夜精品| 欧美一区二区三区人| 免费在线观看一区二区三区| 欧美日韩精品一区视频| 亚洲一区二区精品视频| 91久久线看在观草草青青| 一区二区国产盗摄色噜噜| 91在线观看成人| 一区二区在线看| 欧美在线免费播放|