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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? os_q.c

?? uCos-ii 2.86 在C8051F410單片機(jī)上移植成功!!! 其中包括:UART驅(qū)動(dòng)
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                        MESSAGE QUEUE MANAGEMENT
*
*                              (c) Copyright 1992-2007, Micrium, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_Q.C
* By      : Jean J. Labrosse
* Version : V2.86
*
* LICENSING TERMS:
* ---------------
*   uC/OS-II is provided in source form for FREE evaluation, for educational use or for peaceful research.  
* If you plan on using  uC/OS-II  in a commercial product you need to contact Micri祄 to properly license 
* its use in your product. We provide ALL the source code for your convenience and to help you experience 
* uC/OS-II.   The fact that the  source is provided does  NOT  mean that you can use it without  paying a 
* licensing fee.
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#include "..\header files\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
*
*              perr          is a pointer to where an error message will be deposited.  Possible error
*                            messages are:
*
*                            OS_ERR_NONE         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_ERR_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
*              'perr' 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 *perr) reentrant
{
    void      *pmsg;
    OS_Q      *pq;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#endif



#if OS_ARG_CHK_EN > 0
    if (perr == (INT8U *)0) {                    /* Validate 'perr'                                    */
        return ((void *)0);
    }
    if (pevent == (OS_EVENT *)0) {               /* Validate 'pevent'                                  */
        *perr = OS_ERR_PEVENT_NULL;
        return ((void *)0);
    }
#endif
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {/* Validate event block type                          */
        *perr = 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                   */
        pmsg = *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;
        }
        *perr = OS_ERR_NONE;
    } else {
        *perr = OS_ERR_Q_EMPTY;
        pmsg  = (void *)0;                       /* Queue is empty                                     */
    }
    OS_EXIT_CRITICAL();
    return (pmsg);                               /* 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) reentrant
{
    OS_EVENT  *pevent;
    OS_Q      *pq;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#endif



    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 > 1
            pevent->OSEventName[0] = '?';                  /* Unknown name                             */
            pevent->OSEventName[1] = OS_ASCII_NUL;
#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.
*
*              perr          is a pointer to an error code that can contain one of the following values:
*                            OS_ERR_NONE             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 *perr)	reentrant
{
    BOOLEAN    tasks_waiting;
    OS_EVENT  *pevent_return;
    OS_Q      *pq;
#if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register */
    OS_CPU_SR  cpu_sr = 0;
#endif



#if OS_ARG_CHK_EN > 0
    if (perr == (INT8U *)0) {                              /* Validate 'perr'                          */
        return (pevent);
    }
    if (pevent == (OS_EVENT *)0) {                         /* Validate 'pevent'                        */
        *perr = OS_ERR_PEVENT_NULL;
        return (pevent);
    }
#endif
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {          /* Validate event block type                */
        *perr = OS_ERR_EVENT_TYPE;
        return (pevent);
    }
    if (OSIntNesting > 0) {                                /* See if called from ISR ...               */
        *perr = OS_ERR_DEL_ISR;                            /* ... can't DELETE from an ISR             */
        return (pevent);
    }
    OS_ENTER_CRITICAL();
    if (pevent->OSEventGrp != 0) {                         /* See if any tasks waiting on queue        */
        tasks_waiting = OS_TRUE;                           /* Yes                                      */
    } else {
        tasks_waiting = OS_FALSE;                          /* No                                       */
    }
    switch (opt) {
        case OS_DEL_NO_PEND:                               /* Delete queue only if no task waiting     */
             if (tasks_waiting == OS_FALSE) {
#if OS_EVENT_NAME_SIZE > 1
                 pevent->OSEventName[0] = '?';             /* Unknown name                             */
                 pevent->OSEventName[1] = OS_ASCII_NUL;
#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();
                 *perr                  = OS_ERR_NONE;
                 pevent_return          = (OS_EVENT *)0;   /* Queue has been deleted                   */
             } else {
                 OS_EXIT_CRITICAL();
                 *perr                  = OS_ERR_TASK_WAITING;
                 pevent_return          = pevent;
             }
             break;

        case OS_DEL_ALWAYS:                                /* Always delete the queue                  */
             while (pevent->OSEventGrp != 0) {             /* Ready ALL tasks waiting for queue        */
                 (void)OS_EventTaskRdy(pevent, (void *)0, OS_STAT_Q, OS_STAT_PEND_OK);
             }
#if OS_EVENT_NAME_SIZE > 1
             pevent->OSEventName[0] = '?';                 /* Unknown name                             */
             pevent->OSEventName[1] = OS_ASCII_NUL;
#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();
             if (tasks_waiting == OS_TRUE) {               /* Reschedule only if task(s) were waiting  */
                 OS_Sched();                               /* Find highest priority task ready to run  */
             }
             *perr                  = OS_ERR_NONE;
             pevent_return          = (OS_EVENT *)0;       /* Queue has been deleted                   */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久99精品网久久| 日韩免费视频一区| 欧美高清hd18日本| 久久午夜羞羞影院免费观看| 中文字幕巨乱亚洲| 亚洲一区在线观看免费 | 国产精品一区二区黑丝| 成人av在线看| 欧美日韩国产高清一区二区三区 | 国产精品亚洲视频| 色婷婷av一区二区三区大白胸| 欧美另类变人与禽xxxxx| 国产午夜精品美女毛片视频| 亚洲精品乱码久久久久久日本蜜臀| 视频在线观看一区二区三区| 亚洲精品在线免费播放| 1区2区3区国产精品| 美国毛片一区二区| 91视频.com| 欧美成人精品福利| 一区二区三区在线观看国产| 另类专区欧美蜜桃臀第一页| 91丨九色丨蝌蚪富婆spa| 欧美成人性战久久| 亚洲免费观看高清完整版在线观看熊 | 国产精品短视频| 免费精品99久久国产综合精品| 成人午夜伦理影院| 欧美一区二区播放| 一区二区三区在线视频免费观看| 国产专区综合网| 欧美美女一区二区在线观看| 国产精品乱码妇女bbbb| 免费成人在线影院| 欧美三级三级三级爽爽爽| 欧美激情综合在线| 麻豆免费精品视频| 欧美探花视频资源| 日韩久久一区二区| 国产乱国产乱300精品| 91精品久久久久久蜜臀| 亚洲免费三区一区二区| 欧美激情中文字幕| 麻豆精品在线播放| 在线观看亚洲精品视频| 国产精品你懂的| 国产一区二区伦理片| 欧美一级黄色大片| 亚洲一级二级在线| 91麻豆福利精品推荐| 国产女同互慰高潮91漫画| 久久精品理论片| 日韩一区二区三区av| 亚洲不卡一区二区三区| 色av综合在线| 亚洲欧美电影一区二区| 国产成人精品免费在线| 精品成人一区二区三区| 秋霞电影网一区二区| 欧美日本一区二区三区| 亚洲尤物视频在线| 一本大道久久a久久综合| |精品福利一区二区三区| 丁香桃色午夜亚洲一区二区三区| 26uuu另类欧美| 激情深爱一区二区| 欧美大片在线观看| 精品综合久久久久久8888| 日韩小视频在线观看专区| 日韩不卡在线观看日韩不卡视频| 精品视频一区二区三区免费| 夜夜精品浪潮av一区二区三区| 色天天综合久久久久综合片| 一区二区三区影院| 在线视频一区二区免费| 亚洲线精品一区二区三区八戒| 91豆麻精品91久久久久久| 亚洲激情第一区| 欧美羞羞免费网站| 亚洲大片精品永久免费| 欧美精品久久久久久久久老牛影院| 亚洲成a天堂v人片| 欧美另类变人与禽xxxxx| 日本成人在线看| wwww国产精品欧美| 国产精品88av| 中文字幕一区二区三区乱码在线| www.欧美色图| 亚洲一区在线观看视频| 欧美二区三区91| 韩国av一区二区| 欧美韩国一区二区| 日本韩国一区二区三区| 视频一区二区三区入口| 欧美第一区第二区| 成人激情黄色小说| 一区二区三区高清| 91精品国产高清一区二区三区蜜臀| 美女一区二区在线观看| 久久亚洲精精品中文字幕早川悠里| 成人av资源站| 亚洲一区二区三区精品在线| 欧美一区二区三区在线| 国产一区二区三区免费观看| 中文成人av在线| 欧美亚一区二区| 韩国欧美一区二区| 综合av第一页| 欧美一区二区三区视频免费| 国产成人亚洲综合色影视| 一区二区三区在线视频观看| 欧美一级片在线| 成人免费观看av| 亚洲电影你懂得| 久久综合久久鬼色| 色综合天天综合在线视频| 日韩高清在线观看| 国产精品久久看| 欧美三级电影在线观看| 黑人精品欧美一区二区蜜桃| 亚洲少妇30p| 日韩美女天天操| 99久久精品一区二区| 免费观看在线综合| 日韩久久一区二区| 精品国产凹凸成av人导航| 91在线视频播放地址| 日本不卡高清视频| 国产精品国产三级国产aⅴ原创 | 亚洲国产日产av| 国产午夜亚洲精品理论片色戒| 欧美在线视频不卡| 国产精品综合av一区二区国产馆| 亚洲免费电影在线| 久久久精品免费观看| 欧美高清精品3d| 91麻豆精品一区二区三区| 精品一区二区在线视频| 亚洲最大成人网4388xx| 国产欧美一区二区精品性色| 欧美日韩不卡一区二区| 成人av小说网| 精品一区二区免费| 亚洲福利视频一区| 国产精品沙发午睡系列990531| 在线不卡一区二区| 色偷偷一区二区三区| 国产盗摄女厕一区二区三区| 午夜精品一区二区三区免费视频 | 国产一区二区按摩在线观看| 亚洲福利视频导航| 136国产福利精品导航| 久久精品视频一区二区| 欧美一级理论性理论a| 欧美三区免费完整视频在线观看| 国产成人综合亚洲91猫咪| 免费成人av资源网| 亚洲国产日韩在线一区模特| 亚洲人妖av一区二区| 国产欧美精品一区| 欧美白人最猛性xxxxx69交| 欧美日本一区二区三区| 色狠狠综合天天综合综合| 成人高清视频在线| 国产精品 日产精品 欧美精品| 人人超碰91尤物精品国产| 亚洲成人资源网| 伊人开心综合网| 综合色天天鬼久久鬼色| 中文字幕一区二区视频| 国产精品情趣视频| 国产欧美精品一区| 国产欧美在线观看一区| 久久精品欧美一区二区三区不卡 | 精一区二区三区| 老司机一区二区| 麻豆精品新av中文字幕| 免费不卡在线观看| 蜜臀av性久久久久蜜臀aⅴ四虎 | 日韩久久精品一区| 日韩欧美色综合| 日韩午夜在线观看| 欧美va亚洲va香蕉在线| 欧美大片免费久久精品三p| 日韩欧美一区二区在线视频| 欧美一级片在线看| 日韩免费成人网| 久久新电视剧免费观看| 久久久午夜电影| 久久久久99精品国产片| 国产欧美日韩精品在线| 欧美高清在线精品一区| 中文字幕一区二区在线观看| 亚洲男女毛片无遮挡| 亚洲精选免费视频| 亚洲综合精品自拍| 午夜激情一区二区三区| 免费在线观看视频一区| 激情五月播播久久久精品| 高清不卡一区二区在线|