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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? os_task.c

?? ucos系統(tǒng)
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/*
*********************************************************************************************************
*                                                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.

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区产品免费精品久久75| 欧美无砖专区一中文字| 国产成人午夜99999| 91视频一区二区三区| 欧美午夜不卡在线观看免费| 日韩你懂的在线观看| 中文字幕精品—区二区四季| 亚洲黄色小视频| 麻豆精品在线播放| a在线播放不卡| 欧美蜜桃一区二区三区| 久久久久久一级片| 一区二区三区美女视频| 裸体一区二区三区| 99久久99久久精品免费观看| 欧美电影影音先锋| 国产精品素人视频| 人禽交欧美网站| 91视频在线看| 久久久久国产精品麻豆ai换脸| 一区二区日韩电影| 国产麻豆视频一区| 欧美少妇一区二区| 国产精品女同互慰在线看| 日韩不卡在线观看日韩不卡视频| 国产高清视频一区| 欧美一区二区三区在线电影| 国产精品毛片a∨一区二区三区 | 欧美性大战久久久久久久 | 国产a视频精品免费观看| 欧美视频一区二区在线观看| 久久久久久97三级| 午夜av一区二区| 成人a区在线观看| 欧美大度的电影原声| 一区二区三区中文字幕在线观看| 国产一区二区三区在线观看免费视频| 欧美日韩黄色一区二区| 国产精品女上位| 国内精品伊人久久久久av影院 | 亚洲一区免费观看| 成人网男人的天堂| 精品国产乱码久久久久久浪潮 | 日韩精品一区二区在线观看| 亚洲自拍偷拍图区| 色综合色综合色综合色综合色综合| 日韩精品专区在线影院重磅| 亚洲永久免费视频| 91论坛在线播放| 欧美国产欧美综合| 国产在线精品一区二区三区不卡| 欧美色欧美亚洲另类二区| 国产精品久久久久久户外露出 | 国产精品久久久久三级| 韩国欧美一区二区| 日韩一级片在线观看| 午夜电影一区二区三区| 欧洲日韩一区二区三区| 亚洲女与黑人做爰| 99精品视频一区二区三区| 久久久99精品久久| 国产成人av影院| 久久久久亚洲蜜桃| 国产成人自拍在线| 国产日韩成人精品| 国产传媒一区在线| 欧美激情自拍偷拍| 成人在线综合网站| 国产精品久久久久影院老司 | 亚洲人成在线播放网站岛国| 成人av电影在线观看| 国产精品网站在线播放| 成人黄色av网站在线| 中文字幕精品三区| 99久久亚洲一区二区三区青草| 欧美极品xxx| 99re热视频这里只精品| 亚洲日本免费电影| 欧美三片在线视频观看 | 日韩一区二区三免费高清| 日韩极品在线观看| 欧美一区二区在线免费观看| 偷拍亚洲欧洲综合| 欧美一区二区三区性视频| 日韩国产在线观看一区| 欧美一级一级性生活免费录像| 老司机精品视频线观看86| 精品美女被调教视频大全网站| 久久99精品国产麻豆婷婷洗澡| 精品国产制服丝袜高跟| 国模娜娜一区二区三区| 国产精品私人影院| 91美女福利视频| 亚洲v中文字幕| 日韩精品一区二区三区三区免费| 精品一区二区日韩| 中国色在线观看另类| 色婷婷av久久久久久久| 视频在线观看国产精品| 91精品国产福利在线观看| 国产一区二区女| 日韩美女啊v在线免费观看| 91黄色小视频| 青青草伊人久久| 久久日韩粉嫩一区二区三区| 99在线精品观看| 午夜影院在线观看欧美| 精品成人一区二区三区四区| 不卡的av在线播放| 午夜精品爽啪视频| 精品国产欧美一区二区| 9l国产精品久久久久麻豆| 午夜亚洲国产au精品一区二区| 精品国产一区二区三区忘忧草| 成人黄色一级视频| 婷婷国产在线综合| 国产精品丝袜久久久久久app| 欧美亚洲自拍偷拍| 国产精品中文字幕日韩精品 | 欧美日韩一区在线| 寂寞少妇一区二区三区| 亚洲品质自拍视频网站| 欧美成人乱码一区二区三区| 成人精品gif动图一区| 亚欧色一区w666天堂| 国产欧美日韩精品a在线观看| 欧美视频一区二| 成人一区二区视频| 美国十次了思思久久精品导航| 国产精品入口麻豆九色| 欧美精品黑人性xxxx| 懂色av一区二区三区免费观看| 亚洲国产裸拍裸体视频在线观看乱了| 欧美不卡一二三| 在线观看一区二区视频| 国产精品99久久久久久有的能看 | 日韩一区二区在线看| 北岛玲一区二区三区四区| 秋霞午夜av一区二区三区 | 欧美系列亚洲系列| 成人性生交大片免费看中文网站| 午夜欧美在线一二页| 国产精品国产a| 欧美成人精精品一区二区频| 在线亚洲高清视频| 国产91精品露脸国语对白| 丝袜美腿亚洲色图| 亚洲精品国产a久久久久久| 久久久精品中文字幕麻豆发布| 7777精品伊人久久久大香线蕉的 | 亚洲日穴在线视频| 久久久久久久久伊人| 欧美人体做爰大胆视频| 91亚洲永久精品| 国产激情一区二区三区四区| 美腿丝袜在线亚洲一区| 亚洲成人免费在线| 亚洲色图.com| 中文字幕一区二区在线播放| 国产三级精品三级| 欧美大尺度电影在线| 欧美乱妇23p| 欧美伊人久久久久久久久影院| 99国产精品视频免费观看| 高清beeg欧美| 国产精品一二三区在线| 麻豆国产欧美日韩综合精品二区| 日日夜夜免费精品视频| 亚洲成人高清在线| 亚洲制服丝袜av| 一区二区三区四区在线免费观看| 中文字幕在线观看一区| 中文字幕va一区二区三区| 久久久影视传媒| 久久久久97国产精华液好用吗| www国产精品av| 欧美不卡123| 久久天天做天天爱综合色| 欧美xxxxxxxx| 久久久久久影视| 国产日韩av一区| 中文av字幕一区| 国产精品成人在线观看| 亚洲欧洲日韩女同| 亚洲视频在线一区| 亚洲欧美成aⅴ人在线观看| 一区二区在线观看视频| 亚洲女同ⅹxx女同tv| 亚洲精品日产精品乱码不卡| 亚洲欧美偷拍三级| 亚洲一区二区美女| 香蕉乱码成人久久天堂爱免费| 天涯成人国产亚洲精品一区av| 婷婷激情综合网| 蜜桃视频免费观看一区| 久久99国产精品久久99果冻传媒| 国内精品国产三级国产a久久 | 国产精品久久久久久久岛一牛影视| 最新高清无码专区| 亚洲综合色视频|