亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
2023国产精品| 中文字幕一区二区三区色视频| 亚洲电影在线播放| 日韩久久久久久| 波多野结衣中文字幕一区| 亚洲久草在线视频| 日韩欧美在线1卡| 色八戒一区二区三区| 国产传媒日韩欧美成人| 一个色综合av| 国产精品美女久久久久久2018| 8x福利精品第一导航| 99视频有精品| 粉嫩蜜臀av国产精品网站| 久久99精品久久久久久国产越南| 日本一区二区三区免费乱视频| 欧美日韩成人在线| 91老师国产黑色丝袜在线| 久久国产尿小便嘘嘘| 午夜激情一区二区三区| 亚洲综合图片区| 亚洲综合激情小说| 午夜视频在线观看一区| 一区二区三区中文免费| 亚洲黄网站在线观看| 理论电影国产精品| 激情五月激情综合网| 狠狠色丁香久久婷婷综| 国产成人精品免费一区二区| 国产乱码字幕精品高清av| 国产夫妻精品视频| 北岛玲一区二区三区四区| 成人深夜福利app| 色哦色哦哦色天天综合| 欧美伊人久久久久久久久影院| 欧美日韩免费不卡视频一区二区三区| 欧美老女人在线| 欧美成人猛片aaaaaaa| 久久在线观看免费| 亚洲一区在线观看免费| 99久久777色| 在线观看亚洲a| 久久久久国产精品人| 亚洲伦理在线精品| 久久精品国内一区二区三区| 成人午夜激情影院| 欧美浪妇xxxx高跟鞋交| 国产女主播在线一区二区| 亚洲免费观看视频| 成人美女视频在线观看18| 欧美日韩激情在线| 成人免费一区二区三区视频| 日韩高清一区二区| 欧美天堂亚洲电影院在线播放| 久久久www免费人成精品| 日本欧美韩国一区三区| 欧美性猛交xxxx黑人交| 亚洲欧洲精品一区二区三区不卡| eeuss鲁片一区二区三区 | 欧美高清视频在线高清观看mv色露露十八| 日韩一区二区电影网| 一区二区在线观看视频在线观看| 成人免费视频caoporn| 久久精品一区二区三区四区| 黄一区二区三区| 久久久国产综合精品女国产盗摄| 精品一区二区久久久| 精品国免费一区二区三区| 久久电影网电视剧免费观看| 日韩欧美色电影| 国产999精品久久久久久| 日本一区免费视频| 色婷婷亚洲一区二区三区| 亚洲一区二区三区四区的| 欧美一区二区福利在线| 国产一区二区在线电影| 中文无字幕一区二区三区| 97久久超碰精品国产| 亚洲综合免费观看高清完整版在线| 色综合久久久网| 午夜精品成人在线视频| 欧美精品一区二区在线播放| 成人激情动漫在线观看| 亚洲国产一区二区三区青草影视| 6080日韩午夜伦伦午夜伦| 国产一区啦啦啦在线观看| 亚洲欧美电影院| 日韩精品一区二区三区在线| 99精品黄色片免费大全| 美女性感视频久久| 亚洲精品视频免费观看| 久久中文娱乐网| 欧美一级免费观看| 91麻豆精东视频| 国产精品综合av一区二区国产馆| 亚洲视频一区二区在线观看| 精品国产免费一区二区三区香蕉 | 成人免费va视频| 国产精品亚洲а∨天堂免在线| 亚洲制服丝袜av| 亚洲免费在线视频一区 二区| 久久免费视频色| 欧美精品一区视频| 久久久美女毛片| 国产人久久人人人人爽| 久久精品在线免费观看| 精品噜噜噜噜久久久久久久久试看| 色噜噜狠狠成人中文综合| 色婷婷国产精品| 色av成人天堂桃色av| 色综合天天综合狠狠| 在线免费av一区| 欧美美女黄视频| 2020日本不卡一区二区视频| 2020国产精品久久精品美国| 久久久久九九视频| 亚洲视频一二区| 蜜桃视频在线一区| 国产成人aaa| 欧美三级三级三级爽爽爽| 欧美成人vps| 亚洲人吸女人奶水| 五月激情综合婷婷| 国产高清在线观看免费不卡| 在线精品视频免费播放| 日韩视频123| 亚洲欧美aⅴ...| 久久国内精品视频| 91国产免费观看| 久久久久久久久久久久久女国产乱 | 欧美日韩国产乱码电影| 国产欧美精品一区aⅴ影院| 亚洲一本大道在线| 成人在线综合网| 欧美videossexotv100| 亚洲成av人片一区二区三区| 成人黄动漫网站免费app| 欧美一区二区高清| 亚洲一区二区三区自拍| gogogo免费视频观看亚洲一| 精品乱人伦小说| 久久国产精品一区二区| 欧美性生活久久| 亚洲h在线观看| 在线观看亚洲成人| 午夜精品久久久久久久99水蜜桃 | 在线看国产日韩| 亚洲一区在线视频| 欧美日韩国产经典色站一区二区三区 | 精品毛片乱码1区2区3区| 国产精品你懂的在线欣赏| 国产一区二区中文字幕| 久久天天做天天爱综合色| 国产一区二区女| 中文字幕免费不卡在线| 成人午夜免费视频| 亚洲男人天堂av| 欧美精品视频www在线观看| 视频精品一区二区| 精品国精品国产尤物美女| 国产成人综合精品三级| 国产精品久久免费看| 欧美在线不卡视频| 男男视频亚洲欧美| 1000部国产精品成人观看| 在线精品亚洲一区二区不卡| 亚洲一区在线看| 国产视频一区在线播放| 91国产丝袜在线播放| 天堂一区二区在线| 中文字幕乱码久久午夜不卡| 精品国产精品网麻豆系列| av资源网一区| 国产精品亚洲а∨天堂免在线| 综合中文字幕亚洲| 精品日韩av一区二区| 欧美日韩五月天| www.在线成人| 国产成人自拍网| 激情欧美一区二区| 亚洲成人777| 一区二区三区在线视频观看 | 色婷婷综合久久久中文字幕| 国产一区二区女| 美女一区二区久久| 亚洲成在人线免费| 天堂影院一区二区| 亚洲电影一级片| 一区二区久久久| 亚洲一区二区美女| 亚洲444eee在线观看| 亚洲国产wwwccc36天堂| 伊人开心综合网| 亚洲乱码一区二区三区在线观看| 国产欧美一区二区在线| 欧美激情一二三区| ●精品国产综合乱码久久久久| 国产日韩视频一区二区三区| 久久亚洲精华国产精华液| 久久蜜桃av一区二区天堂|