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

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

?? os_q.c

?? 瑞泰創(chuàng)新的GX-ARM9-2410EP教學(xué)實(shí)驗(yàn)系統(tǒng)的所有基礎(chǔ)實(shí)驗(yàn)源代碼,內(nèi)容齊全,解析清楚,基本上每個(gè)實(shí)驗(yàn)結(jié)果都有圖片顯示
?? C
?? 第 1 頁 / 共 3 頁
字號(hào):
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                        MESSAGE QUEUE MANAGEMENT
*
*                          (c) Copyright 1992-2002, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File : OS_Q.C
* By   : Jean J. Labrosse
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#include "includes.h"
#endif

#if (OS_Q_EN > 0) && (OS_MAX_QS > 0)
/*
*********************************************************************************************************
*                                      ACCEPT MESSAGE FROM QUEUE
*
* Description: This function checks the queue to see if a message is available.  Unlike OSQPend(),
*              OSQAccept() does not suspend the calling task if a message is not available.
*
* Arguments  : pevent        is a pointer to the event control block
*
*              err           is a pointer to where an error message will be deposited.  Possible error
*                            messages are:
*
*                            OS_NO_ERR           The call was successful and your task received a
*                                                message.
*                            OS_ERR_EVENT_TYPE   You didn't pass a pointer to a queue
*                            OS_ERR_PEVENT_NULL  If 'pevent' is a NULL pointer
*                            OS_Q_EMPTY          The queue did not contain any messages
*
* Returns    : != (void *)0  is the message in the queue if one is available.  The message is removed
*                            from the so the next time OSQAccept() is called, the queue will contain
*                            one less entry.
*              == (void *)0  if you received a NULL pointer message
*                            if the queue is empty or,
*                            if 'pevent' is a NULL pointer or,
*                            if you passed an invalid event type
*
* Note(s)    : As of V2.60, you can now pass NULL pointers through queues.  Because of this, the argument
*              'err' has been added to the API to tell you about the outcome of the call.
*********************************************************************************************************
*/

#if OS_Q_ACCEPT_EN > 0
void  *OSQAccept (OS_EVENT *pevent, INT8U *err)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif
    void      *msg;
    OS_Q      *pq;


#if OS_ARG_CHK_EN > 0
    if (pevent == (OS_EVENT *)0) {               /* Validate 'pevent'                                  */
        *err = OS_ERR_PEVENT_NULL;
        return ((void *)0);
    }
#endif
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {/* Validate event block type                          */
        *err = OS_ERR_EVENT_TYPE;
        return ((void *)0);
    }
    OS_ENTER_CRITICAL();
    pq = (OS_Q *)pevent->OSEventPtr;             /* Point at queue control block                       */
    if (pq->OSQEntries > 0) {                    /* See if any messages in the queue                   */
        msg = *pq->OSQOut++;                     /* Yes, extract oldest message from the queue         */
        pq->OSQEntries--;                        /* Update the number of entries in the queue          */
        if (pq->OSQOut == pq->OSQEnd) {          /* Wrap OUT pointer if we are at the end of the queue */
            pq->OSQOut = pq->OSQStart;
        }
        *err = OS_NO_ERR;
    } else {
        *err = OS_Q_EMPTY;
        msg  = (void *)0;                        /* Queue is empty                                     */
    }
    OS_EXIT_CRITICAL();
    return (msg);                                /* Return message received (or NULL)                  */
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                        CREATE A MESSAGE QUEUE
*
* Description: This function creates a message queue if free event control blocks are available.
*
* Arguments  : start         is a pointer to the base address of the message queue storage area.  The
*                            storage area MUST be declared as an array of pointers to 'void' as follows
*
*                            void *MessageStorage[size]
*
*              size          is the number of elements in the storage area
*
* Returns    : != (OS_EVENT *)0  is a pointer to the event control clock (OS_EVENT) associated with the
*                                created queue
*              == (OS_EVENT *)0  if no event control blocks were available or an error was detected
*********************************************************************************************************
*/

OS_EVENT  *OSQCreate (void **start, INT16U size)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif
    OS_EVENT  *pevent;
    OS_Q      *pq;


    if (OSIntNesting > 0) {                      /* See if called from ISR ...                         */
        return ((OS_EVENT *)0);                  /* ... can't CREATE from an ISR                       */
    }
    OS_ENTER_CRITICAL();
    pevent = OSEventFreeList;                    /* Get next free event control block                  */
    if (OSEventFreeList != (OS_EVENT *)0) {      /* See if pool of free ECB pool was empty             */
        OSEventFreeList = (OS_EVENT *)OSEventFreeList->OSEventPtr;
    }
    OS_EXIT_CRITICAL();
    if (pevent != (OS_EVENT *)0) {               /* See if we have an event control block              */
        OS_ENTER_CRITICAL();
        pq = OSQFreeList;                        /* Get a free queue control block                     */
        if (pq != (OS_Q *)0) {                   /* Were we able to get a queue control block ?        */
            OSQFreeList         = OSQFreeList->OSQPtr;    /* Yes, Adjust free list pointer to next free*/
            OS_EXIT_CRITICAL();
            pq->OSQStart        = start;                  /*      Initialize the queue                 */
            pq->OSQEnd          = &start[size];
            pq->OSQIn           = start;
            pq->OSQOut          = start;
            pq->OSQSize         = size;
            pq->OSQEntries      = 0;
            pevent->OSEventType = OS_EVENT_TYPE_Q;
            pevent->OSEventCnt  = 0;
            pevent->OSEventPtr  = pq;
#if OS_EVENT_NAME_SIZE > 0
            (void)strcpy(pevent->OSEventName, "?");
#endif
            OS_EventWaitListInit(pevent);                 /*      Initalize the wait list              */
        } else {
            pevent->OSEventPtr = (void *)OSEventFreeList; /* No,  Return event control block on error  */
            OSEventFreeList    = pevent;
            OS_EXIT_CRITICAL();
            pevent = (OS_EVENT *)0;
        }
    }
    return (pevent);
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                        DELETE A MESSAGE QUEUE
*
* Description: This function deletes a message queue and readies all tasks pending on the queue.
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired
*                            queue.
*
*              opt           determines delete options as follows:
*                            opt == OS_DEL_NO_PEND   Delete the queue ONLY if no task pending
*                            opt == OS_DEL_ALWAYS    Deletes the queue even if tasks are waiting.
*                                                    In this case, all the tasks pending will be readied.
*
*              err           is a pointer to an error code that can contain one of the following values:
*                            OS_NO_ERR               The call was successful and the queue was deleted
*                            OS_ERR_DEL_ISR          If you tried to delete the queue from an ISR
*                            OS_ERR_INVALID_OPT      An invalid option was specified
*                            OS_ERR_TASK_WAITING     One or more tasks were waiting on the queue
*                            OS_ERR_EVENT_TYPE       If you didn't pass a pointer to a queue
*                            OS_ERR_PEVENT_NULL      If 'pevent' is a NULL pointer.
*
* Returns    : pevent        upon error
*              (OS_EVENT *)0 if the queue was successfully deleted.
*
* Note(s)    : 1) This function must be used with care.  Tasks that would normally expect the presence of
*                 the queue MUST check the return code of OSQPend().
*              2) OSQAccept() callers will not know that the intended queue has been deleted unless
*                 they check 'pevent' to see that it's a NULL pointer.
*              3) This call can potentially disable interrupts for a long time.  The interrupt disable
*                 time is directly proportional to the number of tasks waiting on the queue.
*              4) Because ALL tasks pending on the queue will be readied, you MUST be careful in
*                 applications where the queue is used for mutual exclusion because the resource(s)
*                 will no longer be guarded by the queue.
*              5) If the storage for the message queue was allocated dynamically (i.e. using a malloc()
*                 type call) then your application MUST release the memory storage by call the counterpart
*                 call of the dynamic allocation scheme used.  If the queue storage was created statically
*                 then, the storage can be reused.
*********************************************************************************************************
*/

#if OS_Q_DEL_EN > 0
OS_EVENT  *OSQDel (OS_EVENT *pevent, INT8U opt, INT8U *err)
{
#if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register */
    OS_CPU_SR  cpu_sr;
#endif
    BOOLEAN    tasks_waiting;
    OS_Q      *pq;


    if (OSIntNesting > 0) {                                /* See if called from ISR ...               */
        *err = OS_ERR_DEL_ISR;                             /* ... can't DELETE from an ISR             */
        return ((OS_EVENT *)0);
    }
#if OS_ARG_CHK_EN > 0
    if (pevent == (OS_EVENT *)0) {                         /* Validate 'pevent'                        */
        *err = OS_ERR_PEVENT_NULL;
        return (pevent);
    }
#endif
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {          /* Validate event block type                */
        *err = OS_ERR_EVENT_TYPE;
        return (pevent);
    }
    OS_ENTER_CRITICAL();
    if (pevent->OSEventGrp != 0x00) {                      /* See if any tasks waiting on queue        */
        tasks_waiting = TRUE;                              /* Yes                                      */
    } else {
        tasks_waiting = FALSE;                             /* No                                       */
    }
    switch (opt) {
        case OS_DEL_NO_PEND:                               /* Delete queue only if no task waiting     */
             if (tasks_waiting == FALSE) {
#if OS_EVENT_NAME_SIZE > 0
                 (void)strcpy(pevent->OSEventName, "?");   /* Unknown name                             */
#endif
                 pq                  = (OS_Q *)pevent->OSEventPtr;  /* Return OS_Q to free list        */
                 pq->OSQPtr          = OSQFreeList;
                 OSQFreeList         = pq;
                 pevent->OSEventType = OS_EVENT_TYPE_UNUSED;
                 pevent->OSEventPtr  = OSEventFreeList;    /* Return Event Control Block to free list  */
                 pevent->OSEventCnt  = 0;
                 OSEventFreeList     = pevent;             /* Get next free event control block        */
                 OS_EXIT_CRITICAL();
                 *err                = OS_NO_ERR;
                 return ((OS_EVENT *)0);                   /* Queue has been deleted                   */
             } else {
                 OS_EXIT_CRITICAL();
                 *err                = OS_ERR_TASK_WAITING;
                 return (pevent);
             }

        case OS_DEL_ALWAYS:                                /* Always delete the queue                  */
             while (pevent->OSEventGrp != 0x00) {          /* Ready ALL tasks waiting for queue        */
                 OS_EventTaskRdy(pevent, (void *)0, OS_STAT_Q);
             }
#if OS_EVENT_NAME_SIZE > 0
             (void)strcpy(pevent->OSEventName, "?");       /* Unknown name                             */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区久久久久| 老司机免费视频一区二区三区| 欧美久久一区二区| 国产乱子轮精品视频| 亚洲品质自拍视频| 亚洲精品在线电影| 欧美日韩一区中文字幕| 国产宾馆实践打屁股91| 日韩av电影天堂| 亚洲欧美日韩国产综合| 精品va天堂亚洲国产| 欧美三级三级三级| 成人毛片老司机大片| 精品一区二区三区免费视频| 亚洲自拍欧美精品| 亚洲同性同志一二三专区| 久久久久久久久久久99999| 欧美日韩精品一区视频| 色呦呦一区二区三区| 国产成人av一区二区三区在线观看| 日欧美一区二区| 亚洲综合色自拍一区| 国产精品久久久久三级| 国产亚洲精品aa午夜观看| 欧美一区二区三区婷婷月色| 色播五月激情综合网| 99久久精品免费观看| 国产一二三精品| 精品一区二区三区免费播放 | 欧美午夜理伦三级在线观看| 在线综合亚洲欧美在线视频| 91免费观看视频在线| 成人国产精品免费观看视频| 国产一区二区电影| 国产精品伊人色| 国产一区美女在线| 国产毛片精品一区| 国产乱人伦精品一区二区在线观看 | 国产欧美一区二区精品忘忧草| 欧美成人a在线| 精品日韩欧美在线| 精品国产青草久久久久福利| 日韩精品一区二区三区视频在线观看 | 在线91免费看| 欧美一三区三区四区免费在线看| 欧美乱妇20p| 欧美一区二区三区精品| 欧美一级片在线看| 精品久久久久久亚洲综合网| 欧美大片一区二区| 久久久久久综合| 欧美xxx久久| 久久久国产综合精品女国产盗摄| 久久精品欧美一区二区三区不卡| 国产欧美日韩视频在线观看| 国产精品无人区| 亚洲欧美成aⅴ人在线观看| 亚洲欧美另类图片小说| 亚洲自拍偷拍网站| 日本美女一区二区三区| 国产永久精品大片wwwapp| 国产91精品久久久久久久网曝门| jiyouzz国产精品久久| 色狠狠一区二区| 欧美一级日韩免费不卡| 国产三区在线成人av| 亚洲欧美日韩国产综合在线| 天天综合色天天| 国内精品免费在线观看| 波多野结衣亚洲| 欧美三级电影网| 337p粉嫩大胆噜噜噜噜噜91av | 免费三级欧美电影| 国产成人精品一区二区三区四区| av高清久久久| 91精品欧美一区二区三区综合在| 久久色中文字幕| 一区二区在线观看免费视频播放| 香蕉久久夜色精品国产使用方法| 国产综合色视频| 色婷婷综合久久久久中文| 日韩欧美成人午夜| 亚洲视频1区2区| 美美哒免费高清在线观看视频一区二区 | 99视频一区二区| 日韩一区二区在线观看视频| 欧美国产1区2区| 日日夜夜免费精品| fc2成人免费人成在线观看播放| 欧美日韩日日骚| 国产欧美一区二区精品婷婷| 肉丝袜脚交视频一区二区| 成人av网址在线观看| 日韩视频免费观看高清完整版| 国产精品色在线观看| 麻豆精品在线播放| 欧美最猛黑人xxxxx猛交| 久久亚洲私人国产精品va媚药| 亚洲国产精品久久不卡毛片 | 91丨九色丨国产丨porny| 欧美一区二区国产| 亚洲精品自拍动漫在线| 国产毛片精品一区| 日韩欧美中文字幕公布| 亚洲综合免费观看高清完整版在线| 国产美女在线精品| 日韩一级成人av| 性久久久久久久久| 色素色在线综合| 国产精品不卡在线| 国产高清不卡一区| 精品久久久久一区| 日韩专区欧美专区| 在线免费观看日韩欧美| 国产精品国产三级国产aⅴ无密码| 国内精品免费在线观看| 91精品国产免费| 午夜婷婷国产麻豆精品| 日本高清不卡一区| 亚洲免费毛片网站| 91精品福利在线一区二区三区| 亚洲精品国产精华液| 成人av综合在线| 欧美激情综合五月色丁香| 国产一区二区调教| 精品精品国产高清a毛片牛牛| 图片区小说区国产精品视频| 欧美亚洲日本国产| 亚洲综合一二区| 欧美色综合网站| 亚洲国产sm捆绑调教视频 | 欧美日韩极品在线观看一区| 亚洲综合自拍偷拍| 欧美色图第一页| 亚洲.国产.中文慕字在线| 欧美日韩国产在线播放网站| 亚洲小说春色综合另类电影| 欧美伊人精品成人久久综合97| 亚洲精品国产品国语在线app| 色婷婷精品久久二区二区蜜臂av | 日韩丝袜美女视频| 美国毛片一区二区三区| 精品免费一区二区三区| 久久99精品久久久久久国产越南 | 日韩av在线发布| 欧美成人精品福利| 91精品国产91综合久久蜜臀| 日本特黄久久久高潮| 欧美一区二区黄| 国产一区二区免费看| 中文天堂在线一区| 91亚洲男人天堂| 一区二区三区av电影| 欧美一区二区三区免费观看视频 | 亚洲美女视频在线| 欧美日韩三级一区| 韩国成人精品a∨在线观看| 日本一区免费视频| 日本丰满少妇一区二区三区| 亚洲国产日韩a在线播放性色| 制服丝袜激情欧洲亚洲| 精品无人区卡一卡二卡三乱码免费卡| 久久久高清一区二区三区| 大陆成人av片| 亚洲国产精品天堂| 亚洲精品一区二区三区精华液| 成人性生交大片免费看中文网站| 亚洲日本一区二区| 7777精品伊人久久久大香线蕉最新版 | 欧美精品免费视频| 国产美女在线观看一区| 亚洲蜜臀av乱码久久精品| 欧美一级在线观看| 成人动漫视频在线| 日本强好片久久久久久aaa| 中文一区二区完整视频在线观看| 在线观看视频91| 国产中文字幕精品| 亚洲综合免费观看高清完整版在线| 制服丝袜成人动漫| 99在线精品观看| 久久精品久久精品| 亚洲国产精品麻豆| 日韩精品中文字幕一区二区三区| 成人免费视频免费观看| 午夜伦欧美伦电影理论片| 国产欧美精品一区二区色综合| 在线中文字幕一区二区| 国产麻豆午夜三级精品| 午夜欧美在线一二页| 国产一区二区0| 亚洲成人动漫在线观看| 国产精品午夜久久| 日韩欧美成人激情| 欧美丝袜第三区| 成人激情免费网站| 精品中文字幕一区二区小辣椒 | 精品一区二区国语对白| 亚洲综合在线第一页| 国产精品国产三级国产专播品爱网|