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

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

?? os_task.c

?? ucos porting source for Am188
?? 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在线播放| 久久国产生活片100| 精品一区二区精品| 国产精品性做久久久久久| 国产精品一区二区三区乱码| 国产成人在线看| 91蜜桃视频在线| 欧美日韩在线播放一区| 欧美日韩成人在线一区| 欧美大度的电影原声| 久久精品日韩一区二区三区| 国产精品午夜春色av| 亚洲三级在线播放| 日韩激情一二三区| 国精品**一区二区三区在线蜜桃| 国产成人综合在线| 欧美在线高清视频| 欧美一级日韩不卡播放免费| 久久美女高清视频| 亚洲免费观看高清完整版在线观看熊| 免费成人在线观看| 99国产欧美另类久久久精品| 欧美日韩一区二区三区四区五区| 精品国产伦一区二区三区观看体验| 久久久久久久久岛国免费| 亚洲男人的天堂在线aⅴ视频| 亚洲成人av一区| 国产jizzjizz一区二区| 欧美日韩国产经典色站一区二区三区 | 欧美电影影音先锋| 精品国产免费人成电影在线观看四季 | 日韩国产欧美三级| 国产精品一区2区| 欧美三日本三级三级在线播放| 精品黑人一区二区三区久久| 亚洲男人的天堂在线aⅴ视频| 蜜桃一区二区三区在线| 91伊人久久大香线蕉| 日韩欧美国产一区二区三区 | 中文字幕日韩av资源站| 日本aⅴ免费视频一区二区三区| av亚洲精华国产精华精华 | 成人国产精品免费观看| 欧美精品 国产精品| 中文字幕在线不卡国产视频| 国产综合色在线| 欧美精品精品一区| 亚洲麻豆国产自偷在线| 国产精品性做久久久久久| 欧美一区二区在线观看| 尤物av一区二区| 国产一区二区三区黄视频| 3d成人h动漫网站入口| 亚洲免费看黄网站| www.av亚洲| 欧美国产日本韩| 韩国av一区二区三区四区 | 国产成人综合精品三级| 日韩精品一区二区在线| 老鸭窝一区二区久久精品| 欧美精品亚洲一区二区在线播放| 亚洲黄色av一区| 在线免费亚洲电影| 亚洲精选免费视频| av不卡免费电影| 一区在线播放视频| 99久久久久免费精品国产 | 日韩欧美中文字幕精品| 五月天国产精品| 欧美一区二区三区视频在线观看| 丝袜a∨在线一区二区三区不卡| 91行情网站电视在线观看高清版| 亚洲色图欧洲色图| 91久久精品国产91性色tv| 中文字幕一区二区三区精华液| 99r国产精品| 亚洲一区免费在线观看| 911精品国产一区二区在线| 日韩国产欧美在线播放| 精品999在线播放| 成人午夜短视频| 亚洲视频电影在线| 欧美综合一区二区| 日韩av在线发布| 久久久久久久久久久久久久久99 | 欧美日韩一区不卡| 麻豆精品一区二区三区| 中文字幕免费不卡| 一本色道久久综合精品竹菊| 午夜精品福利一区二区三区av| 日韩欧美中文字幕一区| 风间由美一区二区三区在线观看| 自拍偷拍欧美激情| 欧美视频一二三区| 国产一区二区在线观看免费| 中文字幕制服丝袜一区二区三区| 99久久国产综合精品色伊| 日韩高清一级片| 欧美激情在线免费观看| 欧美性三三影院| 国产精品综合二区| 亚洲人快播电影网| 欧美xxxx在线观看| 色婷婷久久综合| 国产曰批免费观看久久久| 亚洲日穴在线视频| 欧美乱妇15p| 成人免费不卡视频| 日本视频一区二区| 亚洲图片你懂的| 精品国产乱码久久久久久图片| 色婷婷综合久久| 国产91精品欧美| 日本伊人午夜精品| 亚洲精品成人精品456| 国产丝袜在线精品| 制服丝袜国产精品| 日韩午夜电影av| 欧洲国内综合视频| 99久久精品国产网站| 国产一区二区主播在线| 蜜桃视频在线一区| 亚洲成人av一区二区| 日韩理论片一区二区| 日本一区二区久久| 26uuu亚洲婷婷狠狠天堂| 欧美日韩不卡一区二区| 91高清视频免费看| www.av亚洲| 成人免费黄色在线| 国产精品一区不卡| 精品一区二区免费看| 日韩国产在线观看一区| 亚洲一区二区在线播放相泽| 国产精品传媒入口麻豆| 国产日韩亚洲欧美综合| 日韩精品一区二区三区在线观看 | 欧美性xxxxx极品少妇| av中文字幕不卡| 成人免费看视频| 波多野结衣中文一区| 成人综合日日夜夜| 国产乱码精品一区二区三区五月婷 | 亚洲一区二区欧美| 亚洲一区免费观看| 亚洲一区在线观看视频| 亚洲一区二区三区爽爽爽爽爽| 一区二区日韩电影| 亚洲精品国产成人久久av盗摄| 亚洲免费资源在线播放| 亚洲人xxxx| 亚洲第一av色| 五月开心婷婷久久| 麻豆久久久久久久| 国产精品一色哟哟哟| 国产成人午夜电影网| 国产不卡视频在线观看| 成人av电影免费在线播放| 成人黄色在线网站| 欧美这里有精品| 欧美精品三级在线观看| 日韩久久免费av| 国产亚洲精品aa| 中文字幕亚洲欧美在线不卡| 一区二区三区中文在线| 图片区小说区区亚洲影院| 裸体健美xxxx欧美裸体表演| 国产成人99久久亚洲综合精品| 成人国产精品视频| 欧美日韩一区二区在线视频| 日韩你懂的在线播放| 国产精品久久久久久久裸模| 亚洲国产精品欧美一二99| 日韩av网站免费在线| 福利一区福利二区| 欧美剧在线免费观看网站 | 91亚洲国产成人精品一区二区三| 色偷偷88欧美精品久久久| 日韩欧美亚洲另类制服综合在线| 国产欧美精品一区| 亚洲一区二区四区蜜桃| 久久se这里有精品| 一本一道久久a久久精品| 精品久久久久一区二区国产| 国产精品国产自产拍高清av | 成人精品高清在线| 在线电影一区二区三区| 亚洲国产精品成人综合色在线婷婷 | 在线观看亚洲专区| 26uuu国产日韩综合| 亚洲永久精品国产| www.亚洲精品| 日韩欧美国产系列| 亚洲一二三四在线| 91在线码无精品|