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

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

?? os_task.c

?? 44binit.s ----- 初始化中斷、存儲(chǔ)器、堆棧等
?? 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);

/*
*********************************************************************************************************
*                                            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.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
777欧美精品| 中文字幕精品三区| 欧美日韩一卡二卡| 91欧美一区二区| av成人免费在线| av一本久道久久综合久久鬼色| 国产69精品一区二区亚洲孕妇| 国产一区二区0| 国产成人av一区二区| 国产成人av一区| 9人人澡人人爽人人精品| voyeur盗摄精品| 色香色香欲天天天影视综合网| 91浏览器在线视频| 欧美综合一区二区| 欧美三级视频在线观看| 777a∨成人精品桃花网| 欧美精品电影在线播放| 91精品国产综合久久小美女| 欧美一区二区高清| 久久综合九色综合欧美亚洲| 国产欧美日韩三级| 亚洲日本一区二区三区| 一区二区三区中文字幕精品精品| 亚洲电影中文字幕在线观看| 日日夜夜精品视频天天综合网| 日本不卡免费在线视频| 激情文学综合丁香| 国产凹凸在线观看一区二区| av中文一区二区三区| 欧美亚洲禁片免费| 日韩精品综合一本久道在线视频| 国产色产综合色产在线视频| 中文字幕在线不卡| 亚洲午夜电影在线| 免费不卡在线观看| 国产在线播放一区| 91在线观看下载| 欧美日韩免费视频| 精品国产第一区二区三区观看体验| 国产欧美日韩麻豆91| 亚洲激情六月丁香| 日本一区中文字幕 | 日韩不卡一二三区| 久草中文综合在线| 91亚洲国产成人精品一区二区三| 精品视频一区二区不卡| 欧美电影免费观看高清完整版在线 | 欧美日韩成人一区二区| 久久久夜色精品亚洲| 亚洲精品中文在线影院| 蜜桃精品视频在线观看| 99re视频精品| 国产精品国产三级国产专播品爱网| 日韩毛片精品高清免费| 久久99在线观看| 在线看日本不卡| 国产亚洲精品7777| 亚洲国产va精品久久久不卡综合 | 宅男噜噜噜66一区二区66| 国产亚洲一区二区三区在线观看 | 久久99精品久久久| 色94色欧美sute亚洲13| 久久久精品人体av艺术| 亚洲va韩国va欧美va| av在线播放不卡| 日韩精品在线看片z| 一区二区三区四区蜜桃 | 精品美女被调教视频大全网站| 亚洲精品国产无套在线观| 国产乱人伦偷精品视频不卡| 欧美日韩国产综合一区二区| 国产精品久久久一本精品 | 免费亚洲电影在线| 日本精品视频一区二区| 国产亚洲一区二区三区在线观看| 日本欧美在线观看| 色欧美片视频在线观看在线视频| 欧美国产禁国产网站cc| 国产麻豆一精品一av一免费 | 亚洲欧洲另类国产综合| 蜜臀av国产精品久久久久| 欧美日韩一区视频| 亚洲人成影院在线观看| 成人h动漫精品| 国产亚洲精品aa午夜观看| 久久福利资源站| 日韩你懂的在线播放| 日韩精品一二三四| 在线观看免费亚洲| 一区二区三区蜜桃网| 99精品视频一区| 国产精品久久一级| 懂色av中文字幕一区二区三区| 日韩欧美在线观看一区二区三区| 亚洲.国产.中文慕字在线| 91官网在线观看| 亚洲日本中文字幕区| 色综合咪咪久久| 依依成人精品视频| 91免费观看视频在线| 亚洲桃色在线一区| 97se狠狠狠综合亚洲狠狠| 中文字幕在线观看不卡| 成人午夜碰碰视频| 日韩中文字幕麻豆| 欧美综合天天夜夜久久| 亚洲一区二区不卡免费| 欧洲一区二区av| 亚洲国产精品一区二区www| 欧洲视频一区二区| 亚洲国产综合人成综合网站| 欧美精三区欧美精三区| 日韩不卡一二三区| 精品剧情v国产在线观看在线| 青青草视频一区| 精品国产精品网麻豆系列| 国产伦精品一区二区三区免费迷 | 日韩国产欧美在线视频| 欧美电影在哪看比较好| 麻豆精品新av中文字幕| 久久久久久久久久看片| a级精品国产片在线观看| 亚洲欧美一区二区三区国产精品| 91亚洲国产成人精品一区二区三| 一区二区三区在线观看动漫| 欧美肥胖老妇做爰| 国内精品国产成人| 国产精品久久久久久久久免费桃花 | 777奇米四色成人影色区| 蜜臀av性久久久久蜜臀aⅴ| 久久婷婷成人综合色| www..com久久爱| 婷婷激情综合网| 国产嫩草影院久久久久| 色域天天综合网| 裸体一区二区三区| 国产精品三级视频| 欧美日韩在线播| 国产精品一区免费在线观看| 亚洲人成网站精品片在线观看 | 亚洲国产欧美另类丝袜| 日韩精品一区二区三区在线| 成人精品视频.| 亚洲国产视频在线| 精品国精品国产| 色综合久久中文字幕| 日本女人一区二区三区| 欧美激情中文不卡| 欧美日韩国产首页在线观看| 国产成人在线色| 亚洲成人www| 亚洲国产成人午夜在线一区| 91久久精品网| 国产精品一二二区| 亚洲h精品动漫在线观看| 精品理论电影在线观看| 在线精品国精品国产尤物884a| 韩国视频一区二区| 亚洲精品午夜久久久| 久久天天做天天爱综合色| 欧美亚洲国产一卡| 国产不卡在线播放| 麻豆91精品91久久久的内涵| 一区二区三区不卡在线观看| 久久久影院官网| 欧美一区二区免费视频| 色94色欧美sute亚洲线路一久 | 成人在线视频一区二区| 三级欧美在线一区| 亚洲精品国久久99热| 国产欧美一区二区精品性色超碰| 欧美精品乱人伦久久久久久| 99在线精品免费| 国产乱一区二区| 麻豆极品一区二区三区| 亚洲二区在线视频| 亚洲日本在线天堂| 欧美国产成人在线| 欧美成人一级视频| 欧美乱妇15p| 在线视频欧美精品| 波多野洁衣一区| 国产乱码精品一区二区三区五月婷| 五月激情六月综合| 一区二区三区色| 中文字幕一区二区三区四区| 久久久久久久久久久99999| 欧美一区二区三区免费视频| 91久久精品国产91性色tv | 中文字幕av一区 二区| 精品国内二区三区| 91精品免费在线| 欧美电影在线免费观看| 欧美三级电影网站| 欧美影院午夜播放| 色噜噜狠狠成人网p站| 99re这里只有精品6| 91亚洲男人天堂| 91美女精品福利|