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

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

?? os_task.c

?? ucos-ii-at90S-icc-avr
?? 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
*********************************************************************************************************
*/


OS_CORE_STATI0C  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
*********************************************************************************************************
*/
OS_CORE_STATI0C 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一区二区三区免费野_久草精品视频
极品少妇xxxx精品少妇| 中文字幕在线免费不卡| 99国产欧美另类久久久精品| 久久成人18免费观看| 美腿丝袜亚洲综合| 美女国产一区二区| 轻轻草成人在线| 裸体一区二区三区| 久久av老司机精品网站导航| 国内久久婷婷综合| 国产成人免费视频网站| 成人午夜在线视频| 91美女在线视频| 欧美日韩一区二区电影| 91精品国产综合久久久久久漫画 | 精品日韩一区二区| 日韩欧美黄色影院| 久久久久99精品国产片| 国产精品乱子久久久久| 亚洲三级在线观看| 亚洲二区在线观看| 经典三级视频一区| aa级大片欧美| 欧美精品 日韩| 久久久精品蜜桃| 一区二区日韩av| 日本va欧美va瓶| 成人毛片视频在线观看| 欧美视频一区二区三区在线观看| 日韩一区二区三区电影在线观看| 国产人成一区二区三区影院| 亚洲综合视频在线观看| 狠狠色丁香婷婷综合| av网站一区二区三区| 欧美区在线观看| 国产欧美日韩卡一| 三级一区在线视频先锋 | 91免费精品国自产拍在线不卡| 91丨九色丨尤物| 日韩欧美二区三区| 亚洲欧美一区二区三区国产精品| 蜜桃视频免费观看一区| 91一区二区在线观看| 精品国产电影一区二区| 亚洲精品免费在线播放| 国内国产精品久久| 制服丝袜成人动漫| 怡红院av一区二区三区| 风流少妇一区二区| 精品成人一区二区三区四区| 亚洲一区二区视频在线| 成人动漫av在线| 欧美精品一区视频| 日韩福利电影在线| 欧美亚洲禁片免费| 国产精品久久久久精k8| 久久精工是国产品牌吗| 欧美久久久久免费| 亚洲夂夂婷婷色拍ww47| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 日韩伦理av电影| 国产成a人亚洲精品| 精品国产精品网麻豆系列| 日韩av不卡在线观看| 欧美日韩一区中文字幕| 一区二区三区国产精品| 99精品国产热久久91蜜凸| 国产精品午夜在线| 成人久久久精品乱码一区二区三区| 精品少妇一区二区三区| 精品一区二区三区在线播放| 777色狠狠一区二区三区| 亚洲电影一级黄| 欧美日韩久久一区二区| 午夜视频在线观看一区二区三区| 在线观看视频一区| 亚洲成av人片在www色猫咪| 欧美亚洲综合在线| 午夜精品福利在线| 日韩一区二区在线播放| 另类小说图片综合网| 精品第一国产综合精品aⅴ| 国产在线视频不卡二| 国产日韩欧美a| kk眼镜猥琐国模调教系列一区二区| 欧美激情一区二区三区蜜桃视频 | 高清不卡一区二区在线| 国产精品免费久久| 91老师国产黑色丝袜在线| 一区二区三区美女| 9191成人精品久久| 国产一区二区在线观看视频| 欧美激情一区二区三区全黄| 99视频超级精品| 午夜精品久久一牛影视| 777色狠狠一区二区三区| 精品一区二区三区免费毛片爱| 久久男人中文字幕资源站| 99九九99九九九视频精品| 亚洲一卡二卡三卡四卡| 日韩欧美一级在线播放| 懂色av一区二区三区蜜臀 | 91激情五月电影| 五月婷婷另类国产| 久久精品欧美日韩精品| 色欧美日韩亚洲| 极品少妇xxxx精品少妇偷拍| 综合欧美一区二区三区| 在线成人小视频| 成人av电影在线观看| 亚洲va欧美va国产va天堂影院| 久久色.com| 91福利在线观看| 国产乱码精品1区2区3区| 亚洲综合免费观看高清完整版在线| 精品国产亚洲一区二区三区在线观看 | 亚洲蜜臀av乱码久久精品 | 中文在线一区二区| 欧美高清视频www夜色资源网| 成人综合日日夜夜| 秋霞成人午夜伦在线观看| 欧美性高清videossexo| 在线成人免费视频| 激情六月婷婷久久| 一卡二卡欧美日韩| 久久婷婷色综合| 欧美日韩不卡在线| 岛国精品一区二区| 久久国产精品免费| 亚洲午夜一区二区| 中文字幕人成不卡一区| 久久蜜臀精品av| 欧美一级国产精品| 欧美少妇bbb| 99re这里都是精品| 成人网页在线观看| 国模无码大尺度一区二区三区| 午夜激情综合网| 一区二区三区在线观看国产| 中文字幕不卡一区| 国产午夜亚洲精品午夜鲁丝片| 欧美成va人片在线观看| 欧美一二三区在线观看| 欧美日韩国产区一| 欧美性三三影院| 色www精品视频在线观看| a在线欧美一区| av在线不卡网| 成人激情电影免费在线观看| 毛片不卡一区二区| 亚洲乱码国产乱码精品精可以看| 国产日韩高清在线| www国产亚洲精品久久麻豆| 日韩三级伦理片妻子的秘密按摩| 欧美午夜精品一区二区三区| 色哟哟国产精品免费观看| 97精品电影院| 91色在线porny| 一本一道波多野结衣一区二区| 不卡一区二区三区四区| 99久免费精品视频在线观看| aaa亚洲精品| 在线观看成人小视频| 欧美三级三级三级爽爽爽| 欧美精品一级二级| 日韩欧美在线1卡| 欧美成人艳星乳罩| 欧美经典三级视频一区二区三区| 国产日产亚洲精品系列| 国产精品久久久久久亚洲毛片| 亚洲天堂中文字幕| 亚洲第一电影网| 激情五月播播久久久精品| 视频一区欧美精品| 欧美精品一区二区三区在线播放| 欧美一级片在线| wwwwxxxxx欧美| 国产精品电影一区二区| 亚洲精品免费在线观看| 肉肉av福利一精品导航| 国产91精品一区二区麻豆网站| 99视频国产精品| 91精品国产欧美一区二区成人 | 一本一道波多野结衣一区二区| 欧美视频一区二区三区四区| 欧美不卡激情三级在线观看| 国产精品久久久久久久久动漫| 午夜精品福利一区二区三区av | 欧美激情在线观看视频免费| 一区二区三区视频在线看| 免费在线一区观看| 91麻豆产精品久久久久久| 91精品国产福利| 亚洲色欲色欲www| 美女一区二区三区在线观看| 91在线观看免费视频| 26uuu国产电影一区二区| 艳妇臀荡乳欲伦亚洲一区| 国产盗摄女厕一区二区三区| 欧美日韩黄色一区二区|