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

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

?? ucos ii v2.9 ?

?? uCOSII_V2.9
?? 9 ?
?? 第 1 頁 / 共 4 頁
字號:
*                                                 during a context switch.
*
* Returns    : OS_ERR_NONE             if the function was successful.
*              OS_PRIO_EXIT            if the task priority already exist
*                                      (each task MUST have a unique priority).
*              OS_ERR_PRIO_INVALID     if the priority you specify is higher that the maximum allowed
*                                      (i.e. > OS_LOWEST_PRIO)
*              OS_ERR_TASK_CREATE_ISR  if you tried to create a task from an ISR.
*********************************************************************************************************
*/
/*$PAGE*/
#if OS_TASK_CREATE_EXT_EN > 0u
INT8U  OSTaskCreateExt (void   (*task)(void *p_arg),
                        void    *p_arg,
                        OS_STK  *ptos,
                        INT8U    prio,
                        INT16U   id,
                        OS_STK  *pbos,
                        INT32U   stk_size,
                        void    *pext,
                        INT16U   opt)
{
    OS_STK    *psp;
    INT8U      err;
#if OS_CRITICAL_METHOD == 3u                 /* Allocate storage for CPU status register               */
    OS_CPU_SR  cpu_sr = 0u;
#endif



#ifdef OS_SAFETY_CRITICAL_IEC61508
    if (OSSafetyCriticalStartFlag == OS_TRUE) {
        OS_SAFETY_CRITICAL_EXCEPTION();
    }
#endif

#if OS_ARG_CHK_EN > 0u
    if (prio > OS_LOWEST_PRIO) {             /* Make sure priority is within allowable range           */
        return (OS_ERR_PRIO_INVALID);
    }
#endif
    OS_ENTER_CRITICAL();
    if (OSIntNesting > 0u) {                 /* Make sure we don't create the task from within an ISR  */
        OS_EXIT_CRITICAL();
        return (OS_ERR_TASK_CREATE_ISR);
    }
    if (OSTCBPrioTbl[prio] == (OS_TCB *)0) { /* Make sure task doesn't already exist at this priority  */
        OSTCBPrioTbl[prio] = OS_TCB_RESERVED;/* Reserve the priority to prevent others from doing ...  */
                                             /* ... the same thing until task is created.              */
        OS_EXIT_CRITICAL();

#if (OS_TASK_STAT_STK_CHK_EN > 0u)
        OS_TaskStkClr(pbos, stk_size, opt);                    /* Clear the task stack (if needed)     */
#endif

        psp = OSTaskStkInit(task, p_arg, ptos, opt);           /* Initialize the task's stack          */
        err = OS_TCBInit(prio, psp, pbos, id, stk_size, pext, opt);
        if (err == OS_ERR_NONE) {
            if (OSRunning == OS_TRUE) {                        /* Find HPT if multitasking has started */
                OS_Sched();
            }
        } else {
            OS_ENTER_CRITICAL();
            OSTCBPrioTbl[prio] = (OS_TCB *)0;                  /* Make this priority avail. to others  */
            OS_EXIT_CRITICAL();
        }
        return (err);
    }
    OS_EXIT_CRITICAL();
    return (OS_ERR_PRIO_EXIST);
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                            DELETE A TASK
*
* Description: This function allows you to delete a task.  The calling task can delete itself by
*              its own priority number.  The deleted task is returned to the dormant state and can be
*              re-activated by creating the deleted task again.
*
* Arguments  : prio    is the priority of the task to delete.  Note that you can explicitely delete
*                      the current task without knowing its priority level by setting 'prio' to
*                      OS_PRIO_SELF.
*
* Returns    : OS_ERR_NONE             if the call is successful
*              OS_ERR_TASK_DEL_IDLE    if you attempted to delete uC/OS-II's idle task
*              OS_ERR_PRIO_INVALID     if the priority you specify is higher that the maximum allowed
*                                      (i.e. >= OS_LOWEST_PRIO) or, you have not specified OS_PRIO_SELF.
*              OS_ERR_TASK_DEL         if the task is assigned to a Mutex PIP.
*              OS_ERR_TASK_NOT_EXIST   if the task you want to delete does not exist.
*              OS_ERR_TASK_DEL_ISR     if you tried to delete a task from an ISR
*
* Notes      : 1) To reduce interrupt latency, OSTaskDel() 'disables' the task:
*                    a) by making it not ready
*                    b) by removing it from any wait lists
*                    c) by preventing OSTimeTick() from making the task ready to run.
*                 The task can then be 'unlinked' from the miscellaneous structures in uC/OS-II.
*              2) The function OS_Dummy() is called after OS_EXIT_CRITICAL() because, on most processors,
*                 the next instruction following the enable interrupt instruction is ignored.
*              3) An ISR cannot delete a task.
*              4) The lock nesting counter is incremented because, for a brief instant, if the current
*                 task is being deleted, the current task would not be able to be rescheduled because it
*                 is removed from the ready list.  Incrementing the nesting counter prevents another task
*                 from being schedule.  This means that an ISR would return to the current task which is
*                 being deleted.  The rest of the deletion would thus be able to be completed.
*********************************************************************************************************
*/

#if OS_TASK_DEL_EN > 0u
INT8U  OSTaskDel (INT8U prio)
{
#if (OS_FLAG_EN > 0u) && (OS_MAX_FLAGS > 0u)
    OS_FLAG_NODE *pnode;
#endif
    OS_TCB       *ptcb;
#if OS_CRITICAL_METHOD == 3u                            /* Allocate storage for CPU status register    */
    OS_CPU_SR     cpu_sr = 0u;
#endif



    if (OSIntNesting > 0u) {                            /* See if trying to delete from ISR            */
        return (OS_ERR_TASK_DEL_ISR);
    }
    if (prio == OS_TASK_IDLE_PRIO) {                    /* Not allowed to delete idle task             */
        return (OS_ERR_TASK_DEL_IDLE);
    }
#if OS_ARG_CHK_EN > 0u
    if (prio >= OS_LOWEST_PRIO) {                       /* Task priority valid ?                       */
        if (prio != OS_PRIO_SELF) {
            return (OS_ERR_PRIO_INVALID);
        }
    }
#endif

/*$PAGE*/
    OS_ENTER_CRITICAL();
    if (prio == OS_PRIO_SELF) {                         /* See if requesting to delete self            */
        prio = OSTCBCur->OSTCBPrio;                     /* Set priority to delete to current           */
    }
    ptcb = OSTCBPrioTbl[prio];
    if (ptcb == (OS_TCB *)0) {                          /* Task to delete must exist                   */
        OS_EXIT_CRITICAL();
        return (OS_ERR_TASK_NOT_EXIST);
    }
    if (ptcb == OS_TCB_RESERVED) {                      /* Must not be assigned to Mutex               */
        OS_EXIT_CRITICAL();
        return (OS_ERR_TASK_DEL);
    }

    OSRdyTbl[ptcb->OSTCBY] &= (OS_PRIO)~ptcb->OSTCBBitX;
    if (OSRdyTbl[ptcb->OSTCBY] == 0u) {                 /* Make task not ready                         */
        OSRdyGrp           &= (OS_PRIO)~ptcb->OSTCBBitY;
    }

#if (OS_EVENT_EN)
    if (ptcb->OSTCBEventPtr != (OS_EVENT *)0) {
        OS_EventTaskRemove(ptcb, ptcb->OSTCBEventPtr);  /* Remove this task from any event   wait list */
    }
#if (OS_EVENT_MULTI_EN > 0u)
    if (ptcb->OSTCBEventMultiPtr != (OS_EVENT **)0) {   /* Remove this task from any events' wait lists*/
        OS_EventTaskRemoveMulti(ptcb, ptcb->OSTCBEventMultiPtr);
    }
#endif
#endif

#if (OS_FLAG_EN > 0u) && (OS_MAX_FLAGS > 0u)
    pnode = ptcb->OSTCBFlagNode;
    if (pnode != (OS_FLAG_NODE *)0) {                   /* If task is waiting on event flag            */
        OS_FlagUnlink(pnode);                           /* Remove from wait list                       */
    }
#endif

    ptcb->OSTCBDly      = 0u;                           /* Prevent OSTimeTick() from updating          */
    ptcb->OSTCBStat     = OS_STAT_RDY;                  /* Prevent task from being resumed             */
    ptcb->OSTCBStatPend = OS_STAT_PEND_OK;
    if (OSLockNesting < 255u) {                         /* Make sure we don't context switch           */
        OSLockNesting++;
    }
    OS_EXIT_CRITICAL();                                 /* Enabling INT. ignores next instruc.         */
    OS_Dummy();                                         /* ... Dummy ensures that INTs will be         */
    OS_ENTER_CRITICAL();                                /* ... disabled HERE!                          */
    if (OSLockNesting > 0u) {                           /* Remove context switch lock                  */
        OSLockNesting--;
    }
    OSTaskDelHook(ptcb);                                /* Call user defined hook                      */
    OSTaskCtr--;                                        /* One less task being managed                 */
    OSTCBPrioTbl[prio] = (OS_TCB *)0;                   /* Clear old priority entry                    */
    if (ptcb->OSTCBPrev == (OS_TCB *)0) {               /* Remove from TCB chain                       */
        ptcb->OSTCBNext->OSTCBPrev = (OS_TCB *)0;
        OSTCBList                  = ptcb->OSTCBNext;
    } else {
        ptcb->OSTCBPrev->OSTCBNext = ptcb->OSTCBNext;
        ptcb->OSTCBNext->OSTCBPrev = ptcb->OSTCBPrev;
    }
    ptcb->OSTCBNext     = OSTCBFreeList;                /* Return TCB to free TCB list                 */
    OSTCBFreeList       = ptcb;
#if OS_TASK_NAME_EN > 0u
    ptcb->OSTCBTaskName = (INT8U *)(void *)"?";
#endif
    OS_EXIT_CRITICAL();
    if (OSRunning == OS_TRUE) {
        OS_Sched();                                     /* Find new highest priority task              */
    }
    return (OS_ERR_NONE);
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                    REQUEST THAT A TASK DELETE ITSELF
*
* Description: This function is used to:
*                   a) notify a task to delete itself.
*                   b) to see if a task requested that the current task delete itself.
*              This function is a little tricky to understand.  Basically, you have a task that needs
*              to be deleted however, this task has resources that it has allocated (memory buffers,
*              semaphores, mailboxes, queues etc.).  The task cannot be deleted otherwise these
*              resources would not be freed.  The requesting task calls OSTaskDelReq() to indicate that
*              the task needs to be deleted.  Deleting of the task is however, deferred to the task to
*              be deleted.  For example, suppose that task #10 needs to be deleted.  The requesting task
*              example, task #5, would call OSTaskDelReq(10).  When task #10 gets to execute, it calls
*              this function by specifying OS_PRIO_SELF and monitors the returned value.  If the return
*              value is OS_ERR_TASK_DEL_REQ, another task requested a task delete.  Task #10 would look like
*              this:
*
*                   void Task(void *p_arg)
*                   {
*                       .
*                       .
*                       while (1) {
*                           OSTimeDly(1);
*                           if (OSTaskDelReq(OS_PRIO_SELF) == OS_ERR_TASK_DEL_REQ) {
*                               Release any owned resources;
*                               De-allocate any dynamic memory;
*                               OSTaskDel(OS_PRIO_SELF);
*                           }
*                       }
*                   }
*
* Arguments  : prio    is the priority of the task to request the delete from
*
* Returns    : OS_ERR_NONE            if the task exist and the request has been registered
*              OS_ERR_TASK_NOT_EXIST  if the task has been deleted.  This allows the caller to know whether
*                                     the request has been executed.
*              OS_ERR_TASK_DEL        if the task is assigned to a Mutex.
*              OS_ERR_TASK_DEL_IDLE   if you requested to delete uC/OS-II's idle task
*              OS_ERR_PRIO_INVALID    if the priority you specify is higher that the maximum allowed
*                                     (i.e. >= OS_LOWEST_PRIO) or, you have not specified OS_PRIO_SELF.
*              OS_ERR_TASK_DEL_REQ    if a task (possibly another task) requested that the running task be
*                                     deleted.
*********************************************************************************************************
*/
/*$PAGE*/
#if OS_TASK_DEL_EN > 0u
INT8U  OSTaskDelReq (INT8U prio)
{
    INT8U      stat;
    OS_TCB    *ptcb;
#if OS_CRITICAL_METHOD == 3u                     /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0u;
#endif



    if (prio == OS_TASK_IDLE_PRIO) {                            /* Not allowed to delete idle task     */
        return (OS_ERR_TASK_DEL_IDLE);
    }
#if OS_ARG_CHK_EN > 0u
    if (prio >= OS_LOWEST_PRIO) {                               /* Task priority valid ?               */
        if (prio != OS_PRIO_SELF) {
            return (OS_ERR_PRIO_INVALID);
        }
    }
#endif
    if (prio == OS_PRIO_SELF) {                                 /* See if a task is requesting to ...  */
        OS_ENTER_CRITICAL();                                    /* ... this task to delete itself      */
        stat = OSTCBCur->OSTCBDelReq;                           /* Return request status to caller     */
        OS_EXIT_CRITICAL();
        return (stat);
    }
    OS_ENTER_CRITICAL();
    ptcb = OSTCBPrioTbl[prio];
    if (ptcb == (OS_TCB *)0) {                                  /* Task to delete must exist           */
        OS_EXIT_CRITICAL();
        return (OS_ERR_TASK_NOT_EXIST);                         /* Task must already be deleted        */
    }
    if (ptcb == OS_TCB_RESERVED) {                              /* Must NOT be assigned to a Mutex     */
        OS_EXIT_CRITICAL();
        return (OS_ERR_TASK_DEL);
    }
    ptcb->OSTCBDelReq = OS_ERR_TASK_DEL_REQ;                    /* Set flag indicating task to be DEL. */
    OS_EXIT_CRITICAL();
    return (OS_ERR_NONE);
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                        GET THE NAME OF A TASK
*
* Description: This function is called to obtain the name of a task.
*
* Arguments  : prio      is the priority of the task that you want to obtain the name from.
*
*              pname     is a pointer to a pointer to an ASCII string that will receive the name of the task.
*
*              perr      is a pointer to an error code that can contain one of the following values:
*
*                        OS_ERR_NONE                if the requested task is resumed
*                        OS_ERR_TASK_NOT_EXIST      if the task has not been created or is assigned to a Mutex
*                        OS_ERR_PRIO_INVALID        if you specified an invalid priority:
*                                                   A higher value than the idle task or not OS_PRIO_SELF.
*                        OS_ERR_PNAME_NULL          You passed a NULL pointer for 'pname'
*                        OS_ERR_NAME_GET_ISR        You called this function from an ISR

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产1区2区3区精品美女| 青青草国产精品97视觉盛宴 | 91老师国产黑色丝袜在线| 欧美精品欧美精品系列| 国产精品每日更新| 麻豆91在线播放| 91官网在线观看| 免费成人你懂的| 色狠狠桃花综合| 中日韩av电影| 久久99蜜桃精品| 欧美片网站yy| 亚洲精品视频免费观看| 国产成人精品网址| 欧美大胆一级视频| 亚洲成人动漫av| 色av成人天堂桃色av| 国产精品免费av| 国产二区国产一区在线观看| 日韩欧美你懂的| 日日骚欧美日韩| 在线观看网站黄不卡| 中文字幕一区二区三区在线播放| 国产一区二区三区精品欧美日韩一区二区三区 | 亚洲一区二区三区四区中文字幕| 成人免费观看av| 国产亚洲女人久久久久毛片| 久久国内精品自在自线400部| 欧美日韩国产综合草草| 一区二区三区日韩欧美| 91丨九色丨国产丨porny| 国产传媒久久文化传媒| 欧美成va人片在线观看| 日韩成人伦理电影在线观看| 欧美色图片你懂的| 亚洲在线观看免费| 在线免费观看视频一区| 一区二区三区精品在线| 色爱区综合激月婷婷| 亚洲精品免费在线播放| 色婷婷av一区二区三区大白胸| 亚洲欧洲日韩在线| 99久久免费视频.com| 中文字幕一区免费在线观看| av在线这里只有精品| 国产精品国产三级国产专播品爱网 | 日韩欧美久久久| 激情另类小说区图片区视频区| 精品国产亚洲一区二区三区在线观看| 精品一区在线看| 久久欧美中文字幕| 国产ts人妖一区二区| 国产精品不卡一区| 91香蕉国产在线观看软件| 亚洲激情成人在线| 欧美高清激情brazzers| 免费人成网站在线观看欧美高清| 欧美成人在线直播| 国产盗摄精品一区二区三区在线 | 欧美精品乱码久久久久久按摩 | 亚洲欧美一区二区三区久本道91| 在线观看国产91| 石原莉奈在线亚洲三区| 日日夜夜精品免费视频| 91精选在线观看| 国产在线视频精品一区| 国产清纯白嫩初高生在线观看91 | 精品一区二区三区在线播放视频| 久久久综合精品| 成人午夜在线播放| 玉米视频成人免费看| 91 com成人网| 国产精品77777竹菊影视小说| 国产精品午夜在线观看| 欧美亚洲一区二区三区四区| 蜜臀国产一区二区三区在线播放| 26uuu精品一区二区三区四区在线| 丁香另类激情小说| 亚洲国产欧美在线| 精品91自产拍在线观看一区| 不卡视频在线观看| 亚洲成人精品一区二区| 久久色在线视频| 色婷婷av久久久久久久| 久久精品国产精品青草| 国产精品成人网| 欧美久久久久久久久久| 国产成人在线看| 亚洲一区在线观看免费| 欧美精品一区二区三区视频| 91免费看视频| 黄页视频在线91| 一区二区三区在线看| 日韩免费高清av| 色视频欧美一区二区三区| 日韩国产欧美在线观看| 国产精品欧美久久久久一区二区| 欧美三级中文字幕在线观看| 国产精品一线二线三线| 亚洲综合免费观看高清在线观看| 欧美成人一级视频| 亚洲精品写真福利| 精品日韩在线观看| 欧美在线观看视频一区二区| 国产成人综合在线观看| 五月天婷婷综合| 中文字幕一区二区在线观看| 日韩欧美中文字幕制服| 日本黄色一区二区| 国产精品一区在线观看乱码 | 久久久国产精品麻豆| 欧美日韩一二三区| 成人国产电影网| 精品制服美女久久| 亚洲成a人片在线不卡一二三区| 欧美激情艳妇裸体舞| 日韩一区国产二区欧美三区| 91国偷自产一区二区三区成为亚洲经典 | 日韩精品最新网址| 欧美体内she精高潮| 99国产麻豆精品| 国产精品一区二区男女羞羞无遮挡| 午夜伊人狠狠久久| 亚洲美女屁股眼交| 国产精品视频九色porn| 欧美第一区第二区| 欧美日韩国产高清一区二区| 99久久久精品免费观看国产蜜| 黄色日韩三级电影| 免费人成精品欧美精品| 91丝袜呻吟高潮美腿白嫩在线观看| 精品一区二区三区免费观看 | 国产精品毛片大码女人| 精品成人a区在线观看| 在线综合亚洲欧美在线视频| 欧美亚洲动漫精品| 色婷婷综合久久久| 91在线观看成人| av一区二区三区四区| 成人国产精品免费| 国产成人免费视频网站高清观看视频| 麻豆精品久久久| 日本成人在线不卡视频| 午夜精品一区二区三区电影天堂 | 五月激情综合网| 亚洲国产欧美在线| 亚洲国产一区二区三区| 亚洲黄色小说网站| 亚洲黄色性网站| 亚洲自拍偷拍图区| 亚洲国产三级在线| 亚洲一二三四区| 亚洲已满18点击进入久久| 一区二区欧美在线观看| 伊人夜夜躁av伊人久久| 一区二区三区日韩精品视频| 一区二区三国产精华液| 亚洲动漫第一页| 欧美午夜一区二区三区免费大片| 在线观看免费视频综合| 欧美色成人综合| 91精品黄色片免费大全| 欧美一区二区三区在线看| 欧美一区二区三区电影| 精品欧美一区二区在线观看 | 色婷婷综合久久| 欧美亚日韩国产aⅴ精品中极品| 欧美性生交片4| 7799精品视频| 精品欧美黑人一区二区三区| 久久美女艺术照精彩视频福利播放| 国产色一区二区| 1区2区3区欧美| 亚洲成人免费电影| 日本不卡的三区四区五区| 九九九精品视频| 成人免费黄色大片| 色94色欧美sute亚洲线路二| 欧美日韩精品久久久| 欧美一级国产精品| 久久精品人人做人人爽97| 国产精品成人免费在线| 亚洲一区二区av在线| 麻豆91小视频| 成人性视频免费网站| 91黄色免费看| 日韩视频国产视频| 日本一区二区三区国色天香| 亚洲人成影院在线观看| 五月天一区二区| 国产露脸91国语对白| 91麻豆123| 欧美一区二区三区喷汁尤物| 久久久99精品久久| 色综合一区二区三区| 欧美日韩黄色一区二区| 久久久综合精品| 亚洲一区二区三区四区的| 精品亚洲成a人在线观看| 暴力调教一区二区三区|