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

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

?? os_task.c

?? uC_OS-II在C51下的一個完整的LCD項目源碼
?? 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) reentrant;

/*
*********************************************************************************************************
*                                            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) reentrant
{
}

/*$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) reentrant
{
    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 *ppdata, OS_STK *ptos, INT8U prio) reentrant
{
    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, ppdata, 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精品久久久久久久91蜜桃| 中文字幕免费不卡在线| 成人欧美一区二区三区黑人麻豆 | 久久精品一区二区三区不卡牛牛| 日本不卡一二三区黄网| 欧美日韩一级二级三级| 国产精品色婷婷久久58| 一区二区三区久久| 欧美亚洲国产一区二区三区 | 欧美狂野另类xxxxoooo| 午夜欧美在线一二页| 日韩欧美国产不卡| 国产99久久久国产精品潘金| 国产精品你懂的| 欧美日韩一区 二区 三区 久久精品| 亚洲一区二区三区自拍| 欧美一区二区三区婷婷月色| 国精产品一区一区三区mba视频| 久久久精品国产免费观看同学| 成人视屏免费看| 亚洲国产婷婷综合在线精品| 欧美一级理论片| 国产成人亚洲综合a∨婷婷| 亚洲欧美另类久久久精品| 在线成人免费视频| 成人ar影院免费观看视频| 亚洲国产一二三| 国产欧美日韩三区| 欧美日韩成人在线一区| 国产高清不卡二三区| 视频一区欧美精品| 中文字幕一区二区三区乱码在线 | 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 另类小说图片综合网| 中文乱码免费一区二区| 欧美日韩国产不卡| 99久久综合色| 国产原创一区二区| 婷婷开心激情综合| 一区二区三区免费| 国产清纯在线一区二区www| 欧美久久一区二区| 91免费在线看| 懂色av一区二区夜夜嗨| 捆绑紧缚一区二区三区视频 | 欧美午夜视频网站| www.亚洲色图| 国产精品一区二区三区99| 午夜精品视频一区| 综合久久国产九一剧情麻豆| 久久久久国产一区二区三区四区 | 狠狠色综合日日| 另类小说图片综合网| 日韩国产一区二| 午夜精品视频一区| 日欧美一区二区| 日韩av一区二区在线影视| 亚洲综合网站在线观看| 一区二区在线观看免费| 亚洲特黄一级片| 亚洲丝袜精品丝袜在线| 欧美国产精品v| 国产欧美一区二区三区在线老狼 | 94-欧美-setu| 成人免费视频网站在线观看| 韩国成人福利片在线播放| 久久精品国产久精国产| 日本在线不卡一区| 精品一区二区三区免费| 国产专区综合网| 国产一区三区三区| 丰满岳乱妇一区二区三区| 成人中文字幕电影| 色呦呦一区二区三区| 在线观看视频一区| 91精品欧美久久久久久动漫| 91精品国产品国语在线不卡| 69av一区二区三区| 日韩精品一区二区在线观看| 久久在线免费观看| 亚洲人被黑人高潮完整版| 亚洲一区在线观看免费观看电影高清| 午夜激情综合网| 国产乱理伦片在线观看夜一区| 国产高清在线观看免费不卡| 91女厕偷拍女厕偷拍高清| 欧美性做爰猛烈叫床潮| 日韩欧美的一区| 中文字幕精品—区二区四季| 中文字幕中文字幕一区| 日韩专区一卡二卡| 国产成人av电影在线| 一本色道久久加勒比精品| 欧美丰满高潮xxxx喷水动漫| 日本一区二区三区国色天香 | 亚洲视频小说图片| 日韩高清不卡一区二区三区| 激情欧美一区二区| 99精品黄色片免费大全| 欧美一级搡bbbb搡bbbb| 最近日韩中文字幕| 青青草97国产精品免费观看 | 亚洲欧美日韩在线| 日本va欧美va精品发布| av午夜一区麻豆| 日韩欧美国产小视频| 亚洲欧美激情视频在线观看一区二区三区| 婷婷成人综合网| 国产精品69久久久久水密桃| 欧美男女性生活在线直播观看| 国产亚洲污的网站| 五月综合激情网| 99国产精品久久久| 久久久www免费人成精品| 午夜视频在线观看一区二区三区| 国产91精品一区二区| 欧美一级片在线观看| 亚洲精品乱码久久久久久黑人| 国产一区二区三区蝌蚪| 欧美色图一区二区三区| 国产精品嫩草影院av蜜臀| 激情综合色播激情啊| 欧美日本一区二区三区四区| 亚洲天堂久久久久久久| 国产91富婆露脸刺激对白| 日韩一区二区在线播放| 日韩制服丝袜先锋影音| 91丨porny丨国产入口| 久久天堂av综合合色蜜桃网| 日韩和欧美一区二区三区| 在线免费一区三区| 亚洲精品五月天| 一本一道波多野结衣一区二区| 日本一区二区三区在线观看| 国产一区二区在线影院| 欧美xxxxxxxxx| 另类中文字幕网| 欧美va日韩va| 蜜桃视频在线观看一区| 欧美一区二区三区在线视频| 日本91福利区| 亚洲精品在线网站| 国产中文字幕精品| 久久久国产午夜精品| 国产91丝袜在线播放0| 中文字幕av一区二区三区免费看 | 久久久久久**毛片大全| 国产精品中文字幕欧美| 久久久久久久久久久久久女国产乱| 日本午夜精品一区二区三区电影 | 国产v综合v亚洲欧| 中文字幕欧美日本乱码一线二线| 国产精品一区专区| 国产精品二三区| 色国产精品一区在线观看| 一区二区三区四区不卡视频| 欧美性猛交xxxx黑人交| 日日骚欧美日韩| 日韩视频在线永久播放| 国产一区二区免费看| 日本一区二区免费在线观看视频| 福利一区二区在线| 亚洲一区二区三区国产| 777欧美精品| 国产激情一区二区三区| 伊人婷婷欧美激情| 精品国产免费人成在线观看| 国产高清在线精品| 亚洲一区二区三区在线播放 | 国模冰冰炮一区二区| 亚洲色图丝袜美腿| 91精品国产乱码| 国产成人自拍网| 亚洲成人激情综合网| 国产亚洲欧洲一区高清在线观看| 一本久道久久综合中文字幕 | 精品亚洲成a人在线观看| 国产欧美日韩三区| 欧美肥大bbwbbw高潮| 成人av影院在线| 男男gaygay亚洲| 国产精品久久三| 日韩精品中文字幕一区| 99久久精品免费精品国产| 秋霞国产午夜精品免费视频| 国产精品你懂的| 精品免费视频.| 欧美日韩一级大片网址| 岛国精品一区二区| 日韩成人免费电影| 最新国产成人在线观看| 精品国产露脸精彩对白| 国产大片一区二区| 日日摸夜夜添夜夜添国产精品| 国产日产欧美一区二区视频| 欧美色视频在线观看| 97成人超碰视| 成人少妇影院yyyy| 激情久久五月天| 日本成人在线电影网|