亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
中国av一区二区三区| 久久日韩精品一区二区五区| 国产99久久久久| 韩国三级中文字幕hd久久精品| 天使萌一区二区三区免费观看| 亚洲二区视频在线| 五月天久久比比资源色| 亚洲成人免费视频| 日本在线观看不卡视频| 麻豆精品在线看| 国产麻豆精品theporn| 国产精品一卡二| 91香蕉视频mp4| 欧美性一区二区| 91精品在线一区二区| 久久老女人爱爱| 国产精品美女一区二区三区| 樱花影视一区二区| 奇米一区二区三区| 粗大黑人巨茎大战欧美成人| 91在线视频播放地址| 欧美性猛交xxxx乱大交退制版| 欧美精品自拍偷拍动漫精品| 精品国免费一区二区三区| 国产精品久久看| 性久久久久久久久| 国产精品一区二区三区乱码| 99久久99久久精品国产片果冻| 精品视频在线免费观看| 精品久久久久一区二区国产| 中文字幕亚洲一区二区va在线| 亚洲在线视频一区| 九九久久精品视频| 9i在线看片成人免费| 91精品久久久久久久91蜜桃| 久久久久久久精| 亚洲va韩国va欧美va精品| 国产精品一区在线观看乱码| 欧美日韩视频专区在线播放| 中文字幕欧美国产| 欧美aⅴ一区二区三区视频| www.在线成人| 精品福利视频一区二区三区| 一区二区三区不卡在线观看| 韩国av一区二区| 欧美日韩一区高清| ㊣最新国产の精品bt伙计久久| 麻豆高清免费国产一区| 色猫猫国产区一区二在线视频| 欧美成人精品3d动漫h| 依依成人精品视频| 成av人片一区二区| 久久久久久久久伊人| 日本美女视频一区二区| 色噜噜狠狠色综合中国| 中文字幕一区二区三区av | 成人午夜在线播放| 日韩精品专区在线影院观看| 亚洲一区二区成人在线观看| 99久久久免费精品国产一区二区| 欧美电影免费观看完整版| 亚洲一区二区三区四区五区中文| 成人一区二区三区视频在线观看| 精品成人在线观看| 人禽交欧美网站| 91久久免费观看| 亚洲精品一二三| 色素色在线综合| 玉米视频成人免费看| 色婷婷精品大在线视频| 一区二区中文字幕在线| 成人一区在线看| 国产日韩av一区二区| 国产精品一色哟哟哟| 久久久久亚洲综合| 国产麻豆成人传媒免费观看| 国产亚洲女人久久久久毛片| 国产麻豆视频一区| 国产精品女同一区二区三区| fc2成人免费人成在线观看播放| 久久精品日产第一区二区三区高清版| 美日韩一区二区| 久久婷婷成人综合色| 国产精品乡下勾搭老头1| 久久综合久久综合久久| 国产99久久精品| 综合av第一页| 欧美性色综合网| 日本vs亚洲vs韩国一区三区| 精品国产一区二区三区忘忧草| 狠狠色丁香婷婷综合久久片| 久久久久久久国产精品影院| a级高清视频欧美日韩| 一区二区三区四区不卡视频| 欧美日韩一区高清| 激情久久五月天| 国产精品国产精品国产专区不片| 一本一道久久a久久精品 | 午夜av电影一区| 精品国产一区久久| 99视频精品在线| 亚洲一卡二卡三卡四卡| 日韩欧美国产综合一区| 波多野洁衣一区| 青椒成人免费视频| 国产精品久久影院| 欧美日韩国产美| 国产成人精品aa毛片| 夜夜精品浪潮av一区二区三区| 制服丝袜国产精品| 成人综合日日夜夜| 午夜精品久久久久久| 国产欧美日韩激情| 欧美一二三四在线| 99久久er热在这里只有精品66| 日本不卡中文字幕| 国产精品美女一区二区在线观看| 欧美高清精品3d| heyzo一本久久综合| 韩国v欧美v亚洲v日本v| 亚洲国产一区二区三区青草影视 | 99热在这里有精品免费| 日韩国产欧美视频| 亚洲男人天堂av| 国产欧美视频一区二区| 在线播放91灌醉迷j高跟美女 | 国产999精品久久久久久| 午夜久久电影网| 日韩美女视频19| 久久精品一区八戒影视| 91精品国产综合久久精品| 色94色欧美sute亚洲线路一ni| 国产专区综合网| 日韩高清在线不卡| 亚洲男人的天堂网| 国产精品丝袜一区| 精品电影一区二区| 精品精品欲导航| 9191精品国产综合久久久久久 | 日韩欧美亚洲国产另类| 欧美亚洲尤物久久| 色综合色狠狠综合色| 99视频有精品| 99久久综合99久久综合网站| 成人国产精品免费| 国产成a人无v码亚洲福利| 加勒比av一区二区| 久久国产精品区| 麻豆91精品视频| 精品一区在线看| 看电视剧不卡顿的网站| 免费av网站大全久久| 免费在线视频一区| 麻豆精品视频在线| 黑人巨大精品欧美黑白配亚洲| 久久99国产精品成人| 韩国理伦片一区二区三区在线播放| 久久99精品久久久久久| 蜜桃久久久久久| 狠狠色狠狠色综合日日91app| 老司机精品视频导航| 经典三级一区二区| 国产在线视频一区二区| 国产一区二区导航在线播放| 国产精品一二三区| 成人18视频日本| 欧美色视频在线| 欧美一级欧美一级在线播放| 精品欧美一区二区在线观看| 国产亚洲成aⅴ人片在线观看| 国产精品天干天干在线综合| 最新高清无码专区| 婷婷亚洲久悠悠色悠在线播放| 美女视频黄久久| 丁香啪啪综合成人亚洲小说| 91一区二区在线观看| 欧美日韩国产高清一区二区三区| 日韩精品一区二区三区四区视频| 精品成人免费观看| 成人免费一区二区三区视频| 亚洲国产精品综合小说图片区| 日本亚洲电影天堂| 国产不卡一区视频| 欧美揉bbbbb揉bbbbb| 久久影院电视剧免费观看| 亚洲欧美日韩国产手机在线| 免费的成人av| 91首页免费视频| 精品久久久久久久久久久久久久久久久 | 一区二区三区波多野结衣在线观看| 亚洲成人av电影| 国产高清久久久| 欧美三区在线观看| 中文幕一区二区三区久久蜜桃| 亚洲国产日韩一级| 国产精品一区二区久激情瑜伽 | 国产视频一区二区在线观看| 一区二区三区在线播| 国内外成人在线视频| 欧美亚洲禁片免费|