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

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

?? os_task.c

?? 移植ucos-II到mcs-51
?? 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一区二区三区免费野_久草精品视频
美腿丝袜亚洲色图| zzijzzij亚洲日本少妇熟睡| 日本高清不卡一区| 亚洲免费三区一区二区| 99精品视频在线观看免费| 国产精品久久777777| 91视频精品在这里| 亚洲欧美日韩一区二区三区在线观看 | 国产综合色视频| 久久久亚洲午夜电影| 国产91在线观看| 自拍偷在线精品自拍偷无码专区| www.色综合.com| 亚洲一区二区高清| 日韩精品一区二区在线观看| 国产在线国偷精品免费看| 日本一区二区三区免费乱视频| 91在线看国产| 午夜精品福利一区二区三区蜜桃| 欧美成人女星排行榜| 粉嫩高潮美女一区二区三区| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 色系网站成人免费| 另类综合日韩欧美亚洲| 欧美激情一区二区三区不卡| 色94色欧美sute亚洲13| 青青草91视频| 亚洲私人影院在线观看| 欧美丰满美乳xxx高潮www| 国产一区二区主播在线| 一区二区三区中文字幕在线观看| 欧美一级艳片视频免费观看| 成人性生交大片| 成人app下载| 国产主播一区二区| 亚洲同性gay激情无套| 欧美日韩高清一区二区不卡| 国产一区二区三区观看| 一区二区三区在线免费| wwww国产精品欧美| 欧美日韩极品在线观看一区| 国产成人99久久亚洲综合精品| 亚洲bt欧美bt精品777| 欧美激情一区二区| 91精品国产综合久久久蜜臀粉嫩| 成人av在线影院| 久久99国产精品尤物| 亚洲在线视频网站| 欧美高清在线一区二区| 欧美一区二区三区视频免费| 99热精品国产| 国产成人h网站| 久久se精品一区精品二区| 亚洲一区二区三区四区五区黄| 国产午夜亚洲精品不卡| 制服丝袜激情欧洲亚洲| 色久综合一二码| 成人av在线播放网址| 国产一区二区伦理| 裸体在线国模精品偷拍| 亚洲国产中文字幕| 亚洲精品美腿丝袜| 亚洲欧洲精品成人久久奇米网| 国产亚洲一区二区在线观看| 91精品国产综合久久精品麻豆| 91视视频在线直接观看在线看网页在线看| 国产福利一区在线| 国产一区二区伦理片| 精品在线亚洲视频| 麻豆精品视频在线观看视频| 五月天激情综合网| 偷拍日韩校园综合在线| 亚洲bt欧美bt精品777| 亚洲国产aⅴ天堂久久| 亚洲天堂成人网| 亚洲日本va午夜在线影院| 国产精品久久久爽爽爽麻豆色哟哟| 久久一日本道色综合| 精品久久久久久久久久久院品网| 91精品欧美一区二区三区综合在| 欧美三区在线观看| 欧美一区二区三区免费大片| 欧美日韩二区三区| 51精品久久久久久久蜜臀| 777奇米成人网| 日韩一区二区三区在线| 欧美变态口味重另类| 久久综合狠狠综合久久综合88 | 亚洲一级在线观看| 亚洲成人精品一区二区| 亚洲电影视频在线| 日韩av电影免费观看高清完整版在线观看 | 色婷婷一区二区三区四区| 99久久久精品免费观看国产蜜| 白白色亚洲国产精品| 91福利国产精品| 91精品久久久久久久91蜜桃 | 欧美三级三级三级| 91麻豆精品国产自产在线观看一区 | 亚洲免费观看视频| 午夜不卡av在线| 国产一区二区福利视频| 国产成人8x视频一区二区| 97成人超碰视| 制服丝袜成人动漫| 国产日韩精品一区二区三区| 国产精品久久久久久久久图文区 | 亚洲成人av免费| 麻豆久久一区二区| 波多野结衣在线aⅴ中文字幕不卡| 色综合久久综合中文综合网| 欧美一区二区啪啪| 国产女人18水真多18精品一级做| 国产精品久久久久久久岛一牛影视 | 综合色天天鬼久久鬼色| 无吗不卡中文字幕| 成人在线一区二区三区| 欧美亚洲高清一区二区三区不卡| 欧美一级在线免费| 成人免费小视频| 美国三级日本三级久久99| www.日韩精品| 日韩欧美国产精品| 亚洲人成亚洲人成在线观看图片| 五月天丁香久久| www.亚洲免费av| 日韩欧美国产wwwww| 亚洲欧洲三级电影| 天天综合天天做天天综合| 国产成人精品www牛牛影视| 欧美群妇大交群中文字幕| 亚洲国产精品国自产拍av| 视频一区视频二区中文字幕| 成人午夜精品一区二区三区| 91精品欧美综合在线观看最新 | 国产一区二区精品久久| 欧美精品一二三| 国产精品久线观看视频| 免费观看在线综合色| 91丝袜美腿高跟国产极品老师| 日韩免费电影一区| 亚洲午夜电影在线观看| www.亚洲色图| 久久久久久免费网| 蜜臀av性久久久久av蜜臀妖精| 色婷婷av一区| 亚洲色图欧美偷拍| 国产成人精品午夜视频免费| 欧美一区二区三区在线电影| 亚洲美女屁股眼交| 粉嫩一区二区三区性色av| 欧美tickling网站挠脚心| 亚洲国产裸拍裸体视频在线观看乱了| 成人一区二区三区在线观看| 欧美大度的电影原声| 亚洲成年人网站在线观看| 日本国产一区二区| **欧美大码日韩| 成人av网站在线观看| 久久精品视频免费| 国产最新精品精品你懂的| 精品国产污污免费网站入口| 日本亚洲电影天堂| 91精品欧美综合在线观看最新| 亚洲国产精品一区二区久久| 色婷婷综合久久久中文一区二区 | 欧美视频自拍偷拍| 樱花影视一区二区| 91久久精品一区二区| 亚洲色图制服诱惑| 欧美在线观看一区二区| 一区二区三区精品视频在线| 在线这里只有精品| 亚洲电影视频在线| 欧美精品少妇一区二区三区| 五月天久久比比资源色| 日韩一区二区影院| 狠狠色丁香九九婷婷综合五月 | 国产欧美1区2区3区| fc2成人免费人成在线观看播放 | 国产亚洲精品中文字幕| 国产盗摄视频一区二区三区| 欧美激情艳妇裸体舞| 99re这里都是精品| 夜夜揉揉日日人人青青一国产精品 | 日韩在线一区二区| 欧美一区二区三区啪啪| 日韩一区中文字幕| 欧美片在线播放| 国产在线观看一区二区| 国产片一区二区三区| 色菇凉天天综合网| 日韩精品乱码免费| 久久久久九九视频| 91麻豆免费在线观看| 午夜久久久影院| 国产日韩欧美亚洲| 日本精品一级二级| 精品在线播放免费| 亚洲婷婷在线视频|