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

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

?? os_task.c

?? dsp芯片TMS320C5416實驗程序
?? 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一区二区三区免费野_久草精品视频
youjizz久久| 在线看一区二区| 免费的成人av| 亚洲123区在线观看| 亚洲综合图片区| 亚洲国产成人高清精品| 亚洲成人av一区二区| 舔着乳尖日韩一区| 久久疯狂做爰流白浆xx| 久久99国产精品免费| 国产精品自拍网站| 99久久精品国产导航| 91美女在线看| 欧美日韩国产精品成人| 日韩欧美一区二区免费| wwwwxxxxx欧美| 亚洲视频你懂的| 五月天丁香久久| 国内成人免费视频| 一本到不卡精品视频在线观看| 91福利在线观看| 精品国产百合女同互慰| 国产精品天天摸av网| 一卡二卡欧美日韩| 久久99精品久久只有精品| 成人免费视频视频| 欧美一区二区视频观看视频| 国产无人区一区二区三区| 亚洲一区二区三区爽爽爽爽爽 | 欧美肥大bbwbbw高潮| 日韩你懂的在线播放| 中文字幕一区二区三区蜜月 | 成人亚洲一区二区一| 在线中文字幕一区| 久久蜜桃av一区二区天堂| 亚洲精品国产精品乱码不99 | 中日韩av电影| 麻豆91在线播放免费| 日本久久一区二区| 日本一二三不卡| 久久国产视频网| 欧美性生活一区| 中文字幕第一区二区| 日本不卡的三区四区五区| 91在线码无精品| 亚洲精品一区二区三区香蕉| 亚洲一区二区在线观看视频| 粉嫩av一区二区三区在线播放| 欧美性色aⅴ视频一区日韩精品| 国产婷婷色一区二区三区在线| 视频在线观看91| 欧美亚洲国产一区在线观看网站| 欧美国产日韩一二三区| 久久国产精品第一页| 欧美日韩成人综合在线一区二区| 成人免费在线播放视频| 国产精品18久久久久久久久| 日韩你懂的在线播放| 日本欧美久久久久免费播放网| 91在线看国产| 国产精品欧美经典| 国产精品亚洲专一区二区三区 | 国产精品嫩草影院av蜜臀| 久久99国内精品| 日韩视频在线永久播放| 亚洲高清在线视频| 欧美在线播放高清精品| 一区二区三区成人在线视频 | 午夜精品久久久久久久久久久| 99免费精品在线观看| 欧美国产激情一区二区三区蜜月| 另类调教123区| 精品精品欲导航| 极品美女销魂一区二区三区| 精品捆绑美女sm三区| 精品一区二区三区免费播放| 精品精品国产高清a毛片牛牛 | 亚洲精品国产无天堂网2021 | 国产天堂亚洲国产碰碰| 国产精品77777竹菊影视小说| 精品成人免费观看| 国产成人免费在线观看不卡| 国产三级精品三级在线专区| 99久久久国产精品免费蜜臀| 亚洲天堂2014| 欧美乱妇一区二区三区不卡视频 | 精品美女一区二区三区| 国产盗摄一区二区| 成人免费一区二区三区在线观看| 色婷婷综合在线| 日韩不卡一区二区三区| 亚洲精品在线网站| 91在线porny国产在线看| 一区2区3区在线看| 日韩欧美专区在线| 不卡一二三区首页| 丝袜美腿成人在线| 久久久久久久久久久久久久久99| 成人毛片在线观看| 亚洲v中文字幕| 久久久www成人免费毛片麻豆| av在线不卡观看免费观看| 亚洲视频狠狠干| 日韩精品在线看片z| av成人老司机| 免费人成在线不卡| 亚洲码国产岛国毛片在线| 欧美一区二区三区公司| 国产成人在线免费| 日韩高清不卡一区二区三区| 国产日韩欧美不卡在线| 欧美日韩国产区一| 成人黄色综合网站| 久久国产视频网| 亚洲伊人伊色伊影伊综合网| 精品免费日韩av| 欧美性受xxxx黑人xyx性爽| 国产精品影音先锋| 天堂午夜影视日韩欧美一区二区| 中文字幕av一区 二区| 欧美福利一区二区| 色综合天天在线| 国产+成+人+亚洲欧洲自线| 亚洲成人综合网站| 亚洲免费观看在线观看| 国产欧美日韩另类一区| 欧美一级欧美三级| 欧美日韩久久久| 色综合久久六月婷婷中文字幕| 国内不卡的二区三区中文字幕 | 精品一区二区三区在线播放视频| 亚洲伊人色欲综合网| 国产精品国模大尺度视频| 久久―日本道色综合久久| 欧美日韩成人一区| 欧美日韩一区二区三区视频| 成人动漫av在线| 国产99久久久国产精品| 久久er99热精品一区二区| 蜜乳av一区二区三区| 日韩成人免费看| 日韩精品欧美精品| 亚洲国产成人av| 亚洲第一av色| 日韩av一区二区三区| 五月天久久比比资源色| 亚洲成a人v欧美综合天堂下载 | 日韩欧美国产系列| 日韩午夜激情视频| 欧美一区二区三区视频在线观看| 在线观看一区二区视频| 在线观看一区二区精品视频| 欧美性猛交xxxx乱大交退制版| 日本道在线观看一区二区| 色94色欧美sute亚洲线路二| 在线免费亚洲电影| 欧美午夜理伦三级在线观看| 欧美性极品少妇| 欧美男女性生活在线直播观看| 欧美乱妇一区二区三区不卡视频| 在线不卡免费欧美| 精品国产欧美一区二区| 国产性色一区二区| 国产精品日韩成人| 亚洲自拍欧美精品| 久久99国产精品久久99果冻传媒| 国产在线播放一区二区三区| 大白屁股一区二区视频| 欧美艳星brazzers| 日韩精品一区二| 国产精品白丝在线| 亚洲大型综合色站| 国产一区二区网址| 91视频在线观看| 777亚洲妇女| 久久久www免费人成精品| 亚洲人123区| 老司机一区二区| 成a人片亚洲日本久久| 欧美日韩国产一级| 久久免费看少妇高潮| 亚洲男人电影天堂| 精品午夜久久福利影院| av男人天堂一区| 欧美精品黑人性xxxx| 裸体在线国模精品偷拍| jvid福利写真一区二区三区| 国产乱子伦视频一区二区三区| 日韩一区二区视频| 亚洲一二三区不卡| 日韩限制级电影在线观看| 国产午夜精品一区二区 | 成人高清视频免费观看| 亚洲在线免费播放| 成人黄色在线网站| 国产精品国产精品国产专区不蜜| 国产成人精品亚洲777人妖| 成人免费av资源| 欧美精品一区二区精品网| 91黄色免费观看|