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

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

?? os_q.c

?? arm7學(xué)習(xí)資料
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/***********************************************************************************************************                                                uC/OS-II*                                          The Real-Time Kernel*                                        MESSAGE QUEUE MANAGEMENT**                          (c) Copyright 1992-2001, 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** 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 the queue is empty or,*                            if 'pevent' is a NULL pointer or,*                            if you passed an invalid event type**********************************************************************************************************/#if OS_Q_ACCEPT_EN > 0void  *OSQAccept (OS_EVENT *pevent){#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'                                  */        return ((void *)0);    }    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {/* Validate event block type                          */        return ((void *)0);    }#endif    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;        }    } else {        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();                     /* Get a free queue control block                     */        pq = OSQFreeList;        if (OSQFreeList != (OS_Q *)0) {            OSQFreeList = OSQFreeList->OSQPtr;        }        OS_EXIT_CRITICAL();        if (pq != (OS_Q *)0) {                   /* See if we were able to get a queue control block   */            pq->OSQStart        = start;         /* Yes, 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->OSEventPtr  = pq;            OS_EventWaitListInit(pevent);        } else {                                 /* No,  since we couldn't get a queue control block   */            OS_ENTER_CRITICAL();                 /* Return event control block on error                */            pevent->OSEventPtr = (void *)OSEventFreeList;            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 > 0OS_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);    }    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {          /* Validate event block type                */        *err = OS_ERR_EVENT_TYPE;        return (pevent);    }#endif    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) {                 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  */                 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);             }             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  */             OSEventFreeList     = pevent;                 /* Get next free event control block        */             OS_EXIT_CRITICAL();             if (tasks_waiting == TRUE) {                  /* Reschedule only if task(s) were waiting  */                 OS_Sched();                               /* Find highest priority task ready to run  */             }             *err = OS_NO_ERR;             return ((OS_EVENT *)0);                       /* Queue has been deleted                   */        default:

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本欧美一区二区三区| 国产亚洲va综合人人澡精品 | 成人污视频在线观看| 91精品午夜视频| 成人免费毛片片v| 老司机一区二区| 国产精品久久久久国产精品日日 | 色婷婷综合久久久中文字幕| 中文字幕在线不卡视频| 精品精品国产高清a毛片牛牛| 色94色欧美sute亚洲线路一ni| 亚洲成人自拍网| 国产亚洲va综合人人澡精品 | 欧美揉bbbbb揉bbbbb| 国产麻豆91精品| 亚洲成人综合视频| 国产精品国产三级国产aⅴ原创 | 不卡大黄网站免费看| 国产一区二区精品久久99| 久久综合综合久久综合| 日韩成人免费电影| 亚洲一区二区三区在线看| ...av二区三区久久精品| 日本一区二区三区在线观看| 欧美一卡二卡三卡四卡| 欧美日韩高清一区二区不卡| 成人开心网精品视频| 国产成人日日夜夜| 国产一区二区不卡| 福利一区福利二区| 国产成人午夜电影网| 国产一区二区91| 国产成人精品免费网站| 激情av综合网| 捆绑调教美女网站视频一区| 国产成人自拍高清视频在线免费播放| 久久蜜臀精品av| 欧美成人性战久久| 欧美一区二区免费| 精品国产91亚洲一区二区三区婷婷| 欧美日韩一区高清| 91精品国产91热久久久做人人| 欧美日韩午夜在线视频| 欧美一区二区三区公司| 91精品国产色综合久久| 欧美成人性战久久| 国产精品免费视频一区| 亚洲手机成人高清视频| 午夜精品免费在线观看| 日韩在线一二三区| 国产一区二区三区在线观看精品| 国产69精品久久777的优势| av欧美精品.com| 视频一区视频二区中文| 国产精品一区二区在线看| eeuss鲁片一区二区三区| 69成人精品免费视频| 精品理论电影在线观看| 国产女同性恋一区二区| 亚洲一区二区三区爽爽爽爽爽| 日本怡春院一区二区| 狠狠色伊人亚洲综合成人| 成人一区二区三区视频在线观看| 不卡的av网站| 欧美大度的电影原声| 国产日韩欧美综合在线| 亚洲一卡二卡三卡四卡五卡| 日本不卡一二三| 成人中文字幕在线| 91精品婷婷国产综合久久竹菊| 国产欧美日韩综合精品一区二区 | 成人免费视频国产在线观看| 欧美日韩一区三区| 国产欧美日韩视频在线观看| 日韩不卡手机在线v区| 成人精品一区二区三区四区| 亚洲国产乱码最新视频| 成人av资源在线观看| 日韩视频免费观看高清完整版 | 欧美一区二区视频在线观看| 中文字幕在线观看一区| 麻豆视频观看网址久久| 国产精品一线二线三线精华| 911精品国产一区二区在线| 欧美日韩国产色站一区二区三区| 久久久久成人黄色影片| 久久麻豆一区二区| 日本午夜一区二区| 91丨九色丨尤物| av资源站一区| 欧美一个色资源| 亚洲123区在线观看| 国产毛片精品国产一区二区三区| 日韩欧美黄色影院| 午夜精品久久久久久久 | 国产精品1区2区3区在线观看| 色诱视频网站一区| 午夜精品久久久久| 欧美一区二区三区色| 日本网站在线观看一区二区三区| 精品999在线播放| 成人国产精品免费| 五月婷婷欧美视频| 日韩美女视频一区二区在线观看| 国产一区二区不卡在线| 一区二区高清视频在线观看| 欧美最新大片在线看| 蜜臀av性久久久久蜜臀av麻豆| 久久这里只精品最新地址| 99精品国产一区二区三区不卡| 亚洲成人免费视频| 国产午夜亚洲精品不卡| 欧美精品久久天天躁| 成人涩涩免费视频| 久久精品国产99久久6| 亚洲免费视频成人| 日韩精品一区二| 91小视频免费观看| 国产九九视频一区二区三区| 中文字幕一区在线| 精品三级av在线| 欧美日韩国产高清一区二区| 成人性生交大片免费看中文网站| 天堂久久久久va久久久久| 综合精品久久久| 精品国产3级a| 欧美一区二区三区在线看| 99在线精品视频| 国产九九视频一区二区三区| 日韩和欧美一区二区| 有码一区二区三区| 自拍偷拍欧美精品| 国产精品国产精品国产专区不蜜| 久久这里只有精品6| 日韩视频国产视频| 欧美一区二区三区在线看| 欧美老年两性高潮| 日本韩国欧美在线| 色综合久久综合中文综合网| 成人精品免费视频| 国产成人精品网址| 成人精品亚洲人成在线| 国产不卡一区视频| 高清久久久久久| 成人综合在线观看| 成人短视频下载| 99久久99久久免费精品蜜臀| jlzzjlzz亚洲日本少妇| 成人h精品动漫一区二区三区| 激情综合色播五月| 极品瑜伽女神91| 国产福利一区在线| 成人午夜av在线| 94-欧美-setu| 91久久精品日日躁夜夜躁欧美| 91在线精品一区二区| 色国产精品一区在线观看| 欧美在线色视频| 51久久夜色精品国产麻豆| 日韩欧美亚洲国产另类| 久久久久9999亚洲精品| 国产精品午夜久久| 亚洲精品乱码久久久久久日本蜜臀| 日韩理论在线观看| 午夜成人在线视频| 久久99国产精品成人| 成人免费看视频| 欧美在线一区二区| 精品久久免费看| 最新中文字幕一区二区三区 | 国产成人午夜电影网| 91网页版在线| 日韩欧美电影一二三| 日本一区二区三区四区在线视频 | 制服.丝袜.亚洲.另类.中文| 精品奇米国产一区二区三区| 亚洲国产精品激情在线观看| 一区二区视频免费在线观看| 免费高清在线视频一区·| 国产福利91精品| 91国产福利在线| 精品国产在天天线2019| 亚洲欧美色图小说| 亚洲电影视频在线| 毛片av一区二区三区| 99久久综合精品| 日韩一级黄色大片| 国产区在线观看成人精品| 亚洲另类春色校园小说| 久久99国内精品| 欧美性淫爽ww久久久久无| 精品电影一区二区| 亚洲超丰满肉感bbw| 成人黄色av电影| 欧美丰满少妇xxxxx高潮对白| 欧美国产1区2区| 精品无人区卡一卡二卡三乱码免费卡| 91麻豆免费看片| 国产精品女同互慰在线看| 美国十次了思思久久精品导航|