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

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

?? os_task.c

?? 這是移植到凌陽十六位單片機上的UCOS 凌陽十六位單片機性能強大
?? 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灌醉迷j高跟美女 | 午夜精品123| 久久精品72免费观看| 91免费版在线| 欧美成人精品福利| 亚洲亚洲精品在线观看| 国产一区日韩二区欧美三区| 欧美在线观看视频一区二区三区 | 视频在线观看一区| 99久久99久久精品免费观看| 精品少妇一区二区三区| 亚洲高清免费观看| hitomi一区二区三区精品| 欧美成人精品二区三区99精品| 国产精品国产精品国产专区不片| 免费av成人在线| 欧洲视频一区二区| 亚洲欧美视频在线观看| 国v精品久久久网| 亚洲精品国产视频| 精品少妇一区二区| 亚洲国产乱码最新视频| 99国产精品久久久| 国产欧美日韩亚州综合| 日本免费在线视频不卡一不卡二| 色综合久久久久综合体| 国产精品免费丝袜| 国产尤物一区二区在线| 精品国内片67194| 日本欧美加勒比视频| 欧美色电影在线| 亚洲一区二区三区四区五区黄 | 美日韩黄色大片| 69精品人人人人| 亚洲国产一区二区视频| 在线观看欧美黄色| 一区二区三区四区五区视频在线观看| 成人18精品视频| 亚洲图片激情小说| 91丝袜美腿高跟国产极品老师 | 久久午夜电影网| 国产一区二区三区香蕉| 久久综合视频网| 国产成人在线电影| 日本一区二区成人在线| 99v久久综合狠狠综合久久| **性色生活片久久毛片| 一本到三区不卡视频| 亚洲一区在线观看视频| 欧美日韩一区二区在线观看| 午夜国产精品影院在线观看| 欧美日本在线一区| 另类成人小视频在线| www国产亚洲精品久久麻豆| 国产成人午夜片在线观看高清观看| 久久久亚洲综合| 99麻豆久久久国产精品免费优播| 亚洲欧美另类小说视频| 7777精品伊人久久久大香线蕉经典版下载 | 一本久道久久综合中文字幕| 亚洲大片在线观看| 欧美成人a∨高清免费观看| 国产精品中文有码| 1024成人网| 制服视频三区第一页精品| 国内成+人亚洲+欧美+综合在线| 久久久亚洲精华液精华液精华液| 成人精品视频一区| 五月综合激情网| 久久婷婷色综合| 在线视频你懂得一区二区三区| 婷婷开心久久网| 中文字幕欧美国产| 欧美日韩国产123区| 国产在线国偷精品产拍免费yy| 综合久久久久综合| 日韩一级黄色大片| 91污在线观看| 精品无人区卡一卡二卡三乱码免费卡| 国产精品美女久久久久aⅴ国产馆| 欧美一a一片一级一片| 激情五月婷婷综合| 亚洲综合一区二区精品导航| 欧美精品一区二区三区蜜桃| 一道本成人在线| 国产精品自拍在线| 日韩av网站免费在线| 中文字幕一区二区三中文字幕 | 成人激情动漫在线观看| 香蕉久久一区二区不卡无毒影院 | 国产精品三级av在线播放| 欧美乱妇15p| 91丨九色porny丨蝌蚪| 国产精一区二区三区| 日韩电影在线一区二区| 亚洲欧美日韩综合aⅴ视频| 26uuu亚洲综合色| 欧美精品1区2区3区| 91啪九色porn原创视频在线观看| 韩国毛片一区二区三区| 日韩国产欧美三级| 亚洲国产一区二区三区| 亚洲桃色在线一区| 国产精品乱码妇女bbbb| 久久久久久久综合日本| 日韩欧美国产一区二区三区| 欧美日韩在线三区| 欧美中文字幕一区| 色综合久久久久网| 色系网站成人免费| 91美女蜜桃在线| 91在线观看地址| 91女神在线视频| 91色视频在线| 色域天天综合网| 91国偷自产一区二区三区成为亚洲经典| 粉嫩高潮美女一区二区三区| 国产美女精品一区二区三区| 激情小说亚洲一区| 国产福利一区二区三区视频在线| 九九视频精品免费| 国产一区二区不卡老阿姨| 国内精品久久久久影院薰衣草| 久久99精品久久久久久国产越南| 美女视频黄久久| 精品午夜一区二区三区在线观看| 美日韩一区二区三区| 黄色资源网久久资源365| 国产在线视频一区二区三区| 国产激情一区二区三区四区| 粉嫩高潮美女一区二区三区| av在线播放一区二区三区| 91丨porny丨中文| 欧美亚洲国产一区二区三区 | 国产美女精品人人做人人爽| 岛国一区二区三区| 一本一道波多野结衣一区二区| 色婷婷综合久久久久中文一区二区 | 色综合久久综合中文综合网| 色噜噜狠狠色综合欧洲selulu| 欧美亚洲一区二区在线| 日韩欧美中文字幕一区| 久久久精品欧美丰满| 一区在线观看免费| 亚洲123区在线观看| 久久福利资源站| 成人av电影观看| 欧美日韩国产经典色站一区二区三区| 这里只有精品视频在线观看| 久久色在线视频| 一区二区三区欧美激情| 免费在线成人网| 国产成人高清在线| 在线观看日韩电影| 久久久久亚洲综合| 亚洲国产综合色| 国产精品18久久久久久久久| 欧美特级限制片免费在线观看| 日韩欧美中文字幕制服| 亚洲人午夜精品天堂一二香蕉| 婷婷亚洲久悠悠色悠在线播放 | 99久久精品国产麻豆演员表| 欧美欧美欧美欧美| 国产精品视频免费| 丝袜国产日韩另类美女| 成人av动漫网站| 日韩欧美国产一二三区| 亚洲另类春色校园小说| 国产一区二区女| 91精品国产色综合久久ai换脸| 国产精品免费av| 久久99国产精品免费网站| 日本精品视频一区二区| 久久精品日韩一区二区三区| 午夜视频在线观看一区二区 | 91在线你懂得| 久久精品无码一区二区三区| 水蜜桃久久夜色精品一区的特点 | 久久亚洲一区二区三区四区| 一区二区三区精品在线| 国产成人精品免费网站| 日韩一区和二区| 亚洲小少妇裸体bbw| 99久久精品免费看国产免费软件| wwwwxxxxx欧美| 久久99久久99精品免视看婷婷 | 亚洲一区二区三区四区不卡| 成人午夜视频免费看| 欧美大尺度电影在线| 亚洲成人免费视频| 在线精品视频小说1| 亚洲四区在线观看| 成人激情免费网站| 国产精品色一区二区三区| 国产裸体歌舞团一区二区| 精品国产制服丝袜高跟| 蜜臀va亚洲va欧美va天堂| 欧美电影一区二区| 视频一区视频二区中文字幕|