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

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

?? os_q.c

?? 此壓縮包中包含了UCOS-II的詳細源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
             *err = OS_ERR_INVALID_OPT;
             return (pevent);
    }
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                           FLUSH QUEUE
*
* Description : This function is used to flush the contents of the message queue.
*
* Arguments   : none
*
* Returns     : OS_NO_ERR           upon success
*               OS_ERR_EVENT_TYPE   If you didn't pass a pointer to a queue
*               OS_ERR_PEVENT_NULL  If 'pevent' is a NULL pointer
*********************************************************************************************************
*/

#if OS_Q_FLUSH_EN > 0
INT8U  OSQFlush (OS_EVENT *pevent)
{
#if OS_CRITICAL_METHOD == 3                           /* Allocate storage for CPU status register      */
    OS_CPU_SR  cpu_sr;
#endif
    OS_Q      *pq;


#if OS_ARG_CHK_EN > 0
    if (pevent == (OS_EVENT *)0) {                    /* Validate 'pevent'                             */
        return (OS_ERR_PEVENT_NULL);
    }
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {     /* Validate event block type                     */
        return (OS_ERR_EVENT_TYPE);
    }
#endif
    OS_ENTER_CRITICAL();
    pq             = (OS_Q *)pevent->OSEventPtr;      /* Point to queue storage structure              */
    pq->OSQIn      = pq->OSQStart;
    pq->OSQOut     = pq->OSQStart;
    pq->OSQEntries = 0;
    OS_EXIT_CRITICAL();
    return (OS_NO_ERR);
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                     PEND ON A QUEUE FOR A MESSAGE
*
* Description: This function waits for a message to be sent to a queue
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired queue
*
*              timeout       is an optional timeout period (in clock ticks).  If non-zero, your task will
*                            wait for a message to arrive at the queue up to the amount of time
*                            specified by this argument.  If you specify 0, however, your task will wait
*                            forever at the specified queue or, until a message arrives.
*
*              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_TIMEOUT          A message was not received within the specified timeout
*                            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_PEND_ISR     If you called this function from an ISR and the result
*                                                would lead to a suspension.
*
* Returns    : != (void *)0  is a pointer to the message received
*              == (void *)0  if no message was received or,
*                            if 'pevent' is a NULL pointer or,
*                            if you didn't pass a pointer to a queue.
*********************************************************************************************************
*/

void  *OSQPend (OS_EVENT *pevent, INT16U timeout, 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 (OSIntNesting > 0) {                      /* See if called from ISR ...                         */
        *err = OS_ERR_PEND_ISR;                  /* ... can't PEND from an ISR                         */
        return ((void *)0);
    }
#if OS_ARG_CHK_EN > 0
    if (pevent == (OS_EVENT *)0) {               /* Validate 'pevent'                                  */
        *err = OS_ERR_PEVENT_NULL;
        return ((void *)0);
    }
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {/* Validate event block type                          */
        *err = OS_ERR_EVENT_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;
        }
        OS_EXIT_CRITICAL();
        *err = OS_NO_ERR;
        return (msg);                            /* Return message received                            */
    }
    OSTCBCur->OSTCBStat |= OS_STAT_Q;            /* Task will have to pend for a message to be posted  */
    OSTCBCur->OSTCBDly   = timeout;              /* Load timeout into TCB                              */
    OS_EventTaskWait(pevent);                    /* Suspend task until event or timeout occurs         */
    OS_EXIT_CRITICAL();
    OS_Sched();                                  /* Find next highest priority task ready to run       */
    OS_ENTER_CRITICAL();
    msg = OSTCBCur->OSTCBMsg;
    if (msg != (void *)0) {                      /* Did we get a message?                              */
        OSTCBCur->OSTCBMsg      = (void *)0;     /* Extract message from TCB (Put there by QPost)      */
        OSTCBCur->OSTCBStat     = OS_STAT_RDY;
        OSTCBCur->OSTCBEventPtr = (OS_EVENT *)0; /* No longer waiting for event                        */
        OS_EXIT_CRITICAL();
        *err                    = OS_NO_ERR;
        return (msg);                            /* Return message received                            */
    }
    OS_EventTO(pevent);                          /* Timed out                                          */
    OS_EXIT_CRITICAL();
    *err = OS_TIMEOUT;                           /* Indicate a timeout occured                         */
    return ((void *)0);                          /* No message received                                */
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                        POST MESSAGE TO A QUEUE
*
* Description: This function sends a message to a queue
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired queue
*
*              msg           is a pointer to the message to send.  You MUST NOT send a NULL pointer.
*
* Returns    : OS_NO_ERR             The call was successful and the message was sent
*              OS_Q_FULL             If the queue cannot accept any more messages because it is full.
*              OS_ERR_EVENT_TYPE     If you didn't pass a pointer to a queue.
*              OS_ERR_PEVENT_NULL    If 'pevent' is a NULL pointer
*              OS_ERR_POST_NULL_PTR  If you are attempting to post a NULL pointer
*********************************************************************************************************
*/

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


#if OS_ARG_CHK_EN > 0
    if (pevent == (OS_EVENT *)0) {                    /* Validate 'pevent'                             */
        return (OS_ERR_PEVENT_NULL);
    }
    if (msg == (void *)0) {                           /* Make sure we are not posting a NULL pointer   */
        return (OS_ERR_POST_NULL_PTR);
    }
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {     /* Validate event block type                     */
        return (OS_ERR_EVENT_TYPE);
    }
#endif
    OS_ENTER_CRITICAL();
    if (pevent->OSEventGrp != 0x00) {                 /* See if any task pending on queue              */
        OS_EventTaskRdy(pevent, msg, OS_STAT_Q);      /* Ready highest priority task waiting on event  */
        OS_EXIT_CRITICAL();
        OS_Sched();                                   /* Find highest priority task ready to run       */
        return (OS_NO_ERR);
    }
    pq = (OS_Q *)pevent->OSEventPtr;                  /* Point to queue control block                  */
    if (pq->OSQEntries >= pq->OSQSize) {              /* Make sure queue is not full                   */
        OS_EXIT_CRITICAL();
        return (OS_Q_FULL);
    }
    *pq->OSQIn++ = msg;                               /* Insert message into queue                     */
    pq->OSQEntries++;                                 /* Update the nbr of entries in the queue        */
    if (pq->OSQIn == pq->OSQEnd) {                    /* Wrap IN ptr if we are at end of queue         */
        pq->OSQIn = pq->OSQStart;
    }
    OS_EXIT_CRITICAL();
    return (OS_NO_ERR);
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                   POST MESSAGE TO THE FRONT OF A QUEUE
*
* Description: This function sends a message to a queue but unlike OSQPost(), the message is posted at
*              the front instead of the end of the queue.  Using OSQPostFront() allows you to send
*              'priority' messages.
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired queue
*
*              msg           is a pointer to the message to send.  You MUST NOT send a NULL pointer.
*
* Returns    : OS_NO_ERR             The call was successful and the message was sent
*              OS_Q_FULL             If the queue cannot accept any more messages because it is full.
*              OS_ERR_EVENT_TYPE     If you didn't pass a pointer to a queue.
*              OS_ERR_PEVENT_NULL    If 'pevent' is a NULL pointer
*              OS_ERR_POST_NULL_PTR  If you are attempting to post to a non queue.
*********************************************************************************************************
*/

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


#if OS_ARG_CHK_EN > 0
    if (pevent == (OS_EVENT *)0) {                    /* Validate 'pevent'                             */
        return (OS_ERR_PEVENT_NULL);
    }
    if (msg == (void *)0) {                           /* Make sure we are not posting a NULL pointer   */
        return (OS_ERR_POST_NULL_PTR);
    }
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {     /* Validate event block type                     */
        return (OS_ERR_EVENT_TYPE);
    }
#endif
    OS_ENTER_CRITICAL();
    if (pevent->OSEventGrp != 0x00) {                 /* See if any task pending on queue              */
        OS_EventTaskRdy(pevent, msg, OS_STAT_Q);      /* Ready highest priority task waiting on event  */
        OS_EXIT_CRITICAL();
        OS_Sched();                                   /* Find highest priority task ready to run       */
        return (OS_NO_ERR);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美一区二区精品性色| 欧美男人的天堂一二区| 精品盗摄一区二区三区| 日韩av不卡在线观看| 欧美高清视频www夜色资源网| 亚洲综合视频在线| 欧美日韩国产另类不卡| 丝袜国产日韩另类美女| 欧美一区二区免费| 国产在线精品一区二区夜色| 国产欧美日韩在线观看| 成人av免费在线播放| 亚洲欧美国产高清| 欧美日韩三级视频| 久久疯狂做爰流白浆xx| 国产亚洲精品超碰| 99re这里都是精品| 亚洲资源在线观看| 日韩限制级电影在线观看| 国产在线视频一区二区三区| 国产精品激情偷乱一区二区∴| 一本一道波多野结衣一区二区| 亚洲国产精品尤物yw在线观看| 欧美一级日韩一级| 成人一区二区三区在线观看| 亚洲自拍偷拍综合| 精品国产乱码久久久久久图片| 成人禁用看黄a在线| 亚洲最色的网站| 日韩欧美高清一区| 色综合色综合色综合色综合色综合 | 国产精品1区二区.| 亚洲欧美日韩精品久久久久| 欧美一级视频精品观看| av一区二区三区在线| 午夜一区二区三区在线观看| 久久精品综合网| 欧美三日本三级三级在线播放| 久久99精品国产麻豆婷婷| 亚洲欧美在线观看| 日韩欧美电影一区| 91日韩一区二区三区| 激情文学综合丁香| 亚洲午夜电影在线观看| 中文在线一区二区| 日韩欧美色综合| 在线看国产一区| 国产成人精品在线看| 午夜伦理一区二区| 亚洲欧美一区二区久久| 久久综合色综合88| 欧美日韩视频不卡| 色婷婷亚洲婷婷| 国产成人免费在线视频| 日韩av电影免费观看高清完整版 | 精品久久久久av影院| 一本色道亚洲精品aⅴ| 国产在线精品一区二区三区不卡 | 2020国产成人综合网| 欧美日韩高清不卡| 91在线国内视频| 国产乱码精品一区二区三区av| 天天免费综合色| 一区二区在线免费| 亚洲欧洲日韩女同| 国产校园另类小说区| 欧美成人精品二区三区99精品| 欧美综合一区二区三区| 91亚洲男人天堂| 国产成人av一区二区| 国产乱色国产精品免费视频| 蜜桃av一区二区三区| 丝袜亚洲另类丝袜在线| 亚洲aaa精品| 午夜欧美大尺度福利影院在线看| 亚洲欧美成aⅴ人在线观看 | 日韩精品综合一本久道在线视频| 欧美图区在线视频| 欧美曰成人黄网| 欧美天堂亚洲电影院在线播放| 色综合久久88色综合天天| 91麻豆高清视频| 日本高清成人免费播放| 99精品视频一区| 色又黄又爽网站www久久| 一本色道亚洲精品aⅴ| 欧美影视一区在线| 欧美日韩国产综合久久| 欧美日韩大陆在线| 日韩一区二区三区电影在线观看| 欧美一区二区视频观看视频| 欧美电视剧免费观看| 亚洲精品一区二区三区香蕉| 欧美精品一区二区三区高清aⅴ| 精品日本一线二线三线不卡| 国产视频一区在线播放| 国产欧美一区二区在线| 国产精品久久久久久久久快鸭| 国产精品毛片高清在线完整版| 国产精品欧美综合在线| 亚洲美女视频在线观看| 亚欧色一区w666天堂| 日韩成人dvd| 国产精品综合av一区二区国产馆| 国产69精品久久777的优势| 99国产精品久久久久| 欧美人成免费网站| 精品国产1区二区| 中文字幕中文字幕中文字幕亚洲无线| 亚洲欧美在线另类| 日本免费在线视频不卡一不卡二| 久久97超碰国产精品超碰| 国产精品一区二区久久精品爱涩| 暴力调教一区二区三区| 欧美私模裸体表演在线观看| 欧美成人午夜电影| 亚洲精品乱码久久久久久 | 免费日韩伦理电影| 成人av网站免费观看| 777欧美精品| 国产精品水嫩水嫩| 五月天激情小说综合| 国产寡妇亲子伦一区二区| 在线观看精品一区| 久久久久青草大香线综合精品| 亚洲狠狠丁香婷婷综合久久久| 美日韩一区二区| 色婷婷av久久久久久久| 精品免费日韩av| 亚洲自拍偷拍麻豆| 国产成人自拍网| 在线综合视频播放| 亚洲欧美日韩小说| 国产精品一区二区久激情瑜伽| 欧美日韩国产高清一区二区 | 日韩一区在线播放| 久久99精品国产麻豆婷婷洗澡| 91国偷自产一区二区三区成为亚洲经典 | 精品盗摄一区二区三区| 亚洲亚洲精品在线观看| 高清不卡一区二区| 日韩欧美专区在线| 亚洲伊人色欲综合网| 国产91精品久久久久久久网曝门| 91精品国产91热久久久做人人| 综合色中文字幕| 成人一区在线观看| 日韩欧美久久一区| 一级女性全黄久久生活片免费| 成人午夜短视频| 久久影院电视剧免费观看| 亚洲成人你懂的| 色婷婷精品久久二区二区蜜臀av | 欧美tk—视频vk| 日韩av一区二区在线影视| 在线一区二区三区| 亚洲欧美乱综合| 成人动漫视频在线| 日本一区二区在线不卡| 极品美女销魂一区二区三区免费| 欧美日韩一卡二卡| 亚洲高清视频在线| 91久久线看在观草草青青| 中文字幕一区二区三区在线不卡| 国产精品一品二品| 精品对白一区国产伦| 国内精品伊人久久久久av影院| 欧美一级日韩免费不卡| 免费一级片91| 日韩欧美一级精品久久| 久久66热re国产| 精品国产精品一区二区夜夜嗨| 日韩成人dvd| 日韩欧美在线123| 极品美女销魂一区二区三区免费| 日韩亚洲欧美一区二区三区| 极品少妇xxxx精品少妇偷拍| 久久亚洲欧美国产精品乐播| 国产一区在线精品| 国产农村妇女毛片精品久久麻豆 | 蜜臂av日日欢夜夜爽一区| 91精品久久久久久久99蜜桃| 免费在线观看一区| 久久天堂av综合合色蜜桃网| 国产成人精品网址| 亚洲欧洲日产国产综合网| 欧美影片第一页| 日韩av一区二区在线影视| 欧美精品一区二区三区高清aⅴ| 国产成人亚洲综合a∨猫咪| 18成人在线观看| 精品视频一区 二区 三区| 老司机精品视频导航| 国产亚洲精久久久久久| 色中色一区二区| 蜜桃免费网站一区二区三区| 国产欧美视频一区二区| 91官网在线观看| 久久er99热精品一区二区| 国产精品人成在线观看免费|