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

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

?? os_task.c

?? S3C44B0開發板的板級測試代碼
?? 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一区二区三区免费野_久草精品视频
久久亚洲精精品中文字幕早川悠里| 欧美日本国产一区| 国产综合色在线视频区| 日韩福利电影在线| 青青草91视频| 国产精品一线二线三线| 粉嫩一区二区三区性色av| 成人免费电影视频| 99久久伊人精品| 欧美性一二三区| 6080午夜不卡| 久久综合色8888| 国产精品国产自产拍在线| 亚洲视频图片小说| 一区二区三区日本| 蜜桃免费网站一区二区三区| 国产伦精品一区二区三区免费迷 | 欧美第一区第二区| 日韩精品一区二区三区三区免费 | 99国产欧美另类久久久精品| 99re66热这里只有精品3直播| 97久久精品人人做人人爽50路 | 欧美v日韩v国产v| 国产丝袜在线精品| 亚洲一区在线视频观看| 蜜乳av一区二区三区| 成人免费高清视频在线观看| 欧美日韩国产一级| 久久综合色之久久综合| 一级女性全黄久久生活片免费| 三级一区在线视频先锋| 高清不卡一区二区| 在线不卡a资源高清| 国产网站一区二区| 日本中文字幕一区二区有限公司| 国产成人精品www牛牛影视| 91传媒视频在线播放| 精品国产乱码久久久久久免费| 中文字幕制服丝袜成人av| 石原莉奈在线亚洲二区| 99vv1com这只有精品| 日韩欧美一区在线| 一区二区三区中文字幕| 美女www一区二区| 欧美伊人久久久久久午夜久久久久| 精品999在线播放| 亚洲成a人片在线不卡一二三区 | 欧美色图免费看| 欧美高清在线一区二区| 欧美aⅴ一区二区三区视频| 99久久综合99久久综合网站| 欧美成va人片在线观看| 亚洲第一搞黄网站| 91一区二区在线| 国产精品无人区| 国产精品一二二区| 久久五月婷婷丁香社区| 久久国内精品视频| 91精品国产手机| 亚洲国产成人高清精品| 在线一区二区三区四区五区| 亚洲人成电影网站色mp4| 懂色中文一区二区在线播放| 精品99一区二区三区| 蜜臀精品久久久久久蜜臀| 欧美亚洲国产一区在线观看网站 | 国产亚洲一区二区三区在线观看 | 国产午夜亚洲精品不卡| 蜜乳av一区二区三区| 欧美一区二区精品| 免费观看一级欧美片| 日韩一区二区三区电影| 日本怡春院一区二区| 91精品国产乱码久久蜜臀| 香蕉成人啪国产精品视频综合网| 一本大道av一区二区在线播放| 国产精品不卡一区| 91成人免费电影| 亚洲在线免费播放| 欧美日本精品一区二区三区| 免费看精品久久片| 久久综合一区二区| 99久久免费视频.com| 亚洲乱码国产乱码精品精的特点 | 国内精品国产成人| 亚洲精品一区在线观看| 国产精品一区在线观看你懂的| 中文字幕av资源一区| 大尺度一区二区| 亚洲综合免费观看高清完整版| 欧美视频在线一区二区三区| 日韩中文字幕av电影| 欧美本精品男人aⅴ天堂| 久久国产精品色| 国产精品污www在线观看| 色婷婷av久久久久久久| 男人操女人的视频在线观看欧美| 日韩免费视频一区二区| 岛国av在线一区| 亚洲成人激情av| 久久免费美女视频| 91网上在线视频| 日本va欧美va精品发布| 中文字幕av资源一区| 91.com视频| 成人av影视在线观看| 婷婷一区二区三区| 国产精品欧美综合在线| 欧美日本精品一区二区三区| 国产成人av电影免费在线观看| 亚洲成人精品在线观看| 国产精品国产自产拍高清av| 欧美人牲a欧美精品| 豆国产96在线|亚洲| 日本在线不卡视频一二三区| 亚洲免费观看视频| 精品国产亚洲一区二区三区在线观看| aaa国产一区| 麻豆成人免费电影| 亚洲综合久久av| 欧美激情一区二区| 精品国产三级a在线观看| 欧美视频一区二| 99精品在线免费| 高清av一区二区| 免费精品视频在线| 午夜久久福利影院| 亚洲综合男人的天堂| 中文字幕精品一区| 久久综合色一综合色88| 欧美男男青年gay1069videost| 97久久超碰精品国产| 国产精一品亚洲二区在线视频| 日韩电影一区二区三区| 亚洲韩国精品一区| 亚洲欧美日韩在线播放| 国产精品乱人伦中文| 国产色产综合产在线视频| 日韩精品在线一区| 欧美一级在线观看| 91精品在线免费观看| 欧美性大战久久久久久久| 97超碰欧美中文字幕| www.在线欧美| 91视频免费播放| 91免费看视频| 一本一道波多野结衣一区二区| 岛国一区二区三区| av中文一区二区三区| va亚洲va日韩不卡在线观看| www.欧美色图| 91丨porny丨中文| 99久久国产免费看| 欧美午夜不卡视频| 欧美一区欧美二区| 欧美一区二区二区| 久久久噜噜噜久噜久久综合| 精品久久人人做人人爰| 精品欧美乱码久久久久久1区2区 | 欧美日韩www| 欧美一区二区免费视频| 精品日产卡一卡二卡麻豆| 国产亚洲精品精华液| 国产精品成人一区二区三区夜夜夜 | 一卡二卡欧美日韩| 亚洲成av人片| 韩国女主播成人在线观看| 成人午夜激情在线| 欧美三级三级三级爽爽爽| 欧美精品乱码久久久久久按摩| 欧美精品视频www在线观看| 欧美一级午夜免费电影| 精品欧美乱码久久久久久1区2区| 国产清纯美女被跳蛋高潮一区二区久久w| 国产丝袜欧美中文另类| 一区二区三区欧美日韩| 亚洲va韩国va欧美va| 狠狠色丁香久久婷婷综| 成a人片国产精品| 在线综合+亚洲+欧美中文字幕| 国产午夜精品在线观看| 一区二区三区中文在线观看| 老司机免费视频一区二区三区| 国产剧情一区二区三区| 欧美综合亚洲图片综合区| 欧美大片顶级少妇| 国产精品对白交换视频| 丝袜美腿成人在线| 成人av网站在线观看| 欧美日韩国产精品成人| 国产偷国产偷精品高清尤物| 亚洲第一综合色| 成人av在线观| 欧美xxxxxxxx| 亚洲一区中文日韩| 国产成人av影院| 欧美日本高清视频在线观看| 亚洲日本在线天堂| 国产盗摄女厕一区二区三区| 欧美日韩国产免费一区二区|