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

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

?? os_q.c

?? C51下uc/osii的一個完整的LCD項目源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
*
*              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_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 you didn't pass a pointer to a queue.
*********************************************************************************************************
*/

void *OSQPend (OS_EVENT *pevent, INT16U timeout, INT8U *err) reentrant
{
    void  *msg;
    OS_Q  *pq;


    OS_ENTER_CRITICAL();
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {/* Validate event block type                          */
        OS_EXIT_CRITICAL();
        *err = OS_ERR_EVENT_TYPE;
        return ((void *)0);
    }
    pq = 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;
    } else if (OSIntNesting > 0) {               /* See if called from ISR ...                         */
        OS_EXIT_CRITICAL();                      /* ... can't PEND from an ISR                         */
        *err = OS_ERR_PEND_ISR;
    } else {
        OSTCBCur->OSTCBStat    |= OS_STAT_Q;     /* Task will have to pend for a message to be posted  */
        OSTCBCur->OSTCBDly      = timeout;       /* Load timeout into TCB                              */
        OSEventTaskWait(pevent);                 /* Suspend task until event or timeout occurs         */
        OS_EXIT_CRITICAL();
        OSSched();                               /* Find next highest priority task ready to run       */
        OS_ENTER_CRITICAL();
        if ((msg = OSTCBCur->OSTCBMsg) != (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;
        } else if (OSTCBCur->OSTCBStat & OS_STAT_Q) { /* Timed out if status indicates pending on Q    */
            OSEventTO(pevent);
            OS_EXIT_CRITICAL();
            msg                     = (void *)0;      /* No message received                           */
            *err                    = OS_TIMEOUT;     /* Indicate a timeout occured                    */
        } else {
            msg = *pq->OSQOut++;                      /* Extract message from 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 Q    */
                pq->OSQOut = pq->OSQStart;
            }
            OSTCBCur->OSTCBEventPtr = (OS_EVENT *)0;
            OS_EXIT_CRITICAL();
            *err = OS_NO_ERR;
        }
    }                                                 
    return (msg);                                     /* Return message received (or NULL)             */
}
/*$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.
*********************************************************************************************************
*/

INT8U OSQPost (OS_EVENT *pevent, void *msg) reentrant
{
    OS_Q   *pq;


    OS_ENTER_CRITICAL();
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {     /* Validate event block type                     */
        OS_EXIT_CRITICAL();
        return (OS_ERR_EVENT_TYPE);
    }
    if (pevent->OSEventGrp) {                         /* See if any task pending on queue              */
        OSEventTaskRdy(pevent, msg, OS_STAT_Q);       /* Ready highest priority task waiting on event  */
        OS_EXIT_CRITICAL();
        OSSched();                                    /* Find highest priority task ready to run       */
        return (OS_NO_ERR);
    } else {
        pq = 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);
        } else {
            *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);
    }
}
/*$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.
*********************************************************************************************************
*/

INT8U OSQPostFront (OS_EVENT *pevent, void *msg) reentrant
{
    OS_Q   *pq;


    OS_ENTER_CRITICAL();
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {     /* Validate event block type                     */
        OS_EXIT_CRITICAL();
        return (OS_ERR_EVENT_TYPE);
    }
    if (pevent->OSEventGrp) {                         /* See if any task pending on queue              */
        OSEventTaskRdy(pevent, msg, OS_STAT_Q);       /* Ready highest priority task waiting on event  */
        OS_EXIT_CRITICAL();
        OSSched();                                    /* Find highest priority task ready to run       */
        return (OS_NO_ERR);
    } else {
        pq = 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);
        } else {
            if (pq->OSQOut == pq->OSQStart) {         /* Wrap OUT ptr if we are at the 1st queue entry */
                pq->OSQOut = pq->OSQEnd;
            }
            pq->OSQOut--;
            *pq->OSQOut = msg;                        /* Insert message into queue                     */
            pq->OSQEntries++;                         /* Update the nbr of entries in the queue        */
            OS_EXIT_CRITICAL();
        }
        return (OS_NO_ERR);
    }
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                        QUERY A MESSAGE QUEUE
*
* Description: This function obtains information about a message queue.
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired mailbox
*
*              pdata         is a pointer to a structure that will contain information about the message
*                            queue.
*
* Returns    : OS_NO_ERR          The call was successful and the message was sent
*              OS_ERR_EVENT_TYPE  If you are attempting to obtain data from a non queue.
*********************************************************************************************************
*/

INT8U OSQQuery (OS_EVENT *pevent, OS_Q_DATA *ppdata) reentrant
{
    OS_Q   *pq;
    INT8U   i;
    INT8U  *psrc;
    INT8U  *pdest;
    
    
    OS_ENTER_CRITICAL();
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {          /* Validate event block type                */
        OS_EXIT_CRITICAL();
        return (OS_ERR_EVENT_TYPE);
    }
    ppdata->OSEventGrp = pevent->OSEventGrp;                /* Copy message mailbox wait list           */
    psrc              = &pevent->OSEventTbl[0];
    pdest             = &ppdata->OSEventTbl[0];
    for (i = 0; i < OS_EVENT_TBL_SIZE; i++) {
        *pdest++ = *psrc++;   
    }
    pq = (OS_Q *)pevent->OSEventPtr;
    if (pq->OSQEntries > 0) {
        ppdata->OSMsg = pq->OSQOut;                         /* Get next message to return if available  */
    } else {
        ppdata->OSMsg = (void *)0;
    }
    ppdata->OSNMsgs = pq->OSQEntries;
    ppdata->OSQSize = pq->OSQSize;
    OS_EXIT_CRITICAL();
    return (OS_NO_ERR);
}
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
九九在线精品视频| 日本女优在线视频一区二区| 精品国产91亚洲一区二区三区婷婷| 91首页免费视频| 91视频免费播放| 一本一道久久a久久精品| 成人精品在线视频观看| 91亚洲国产成人精品一区二三| 国产不卡视频在线播放| 成人h精品动漫一区二区三区| av激情综合网| 色视频成人在线观看免| 精品视频一区 二区 三区| 欧美人与禽zozo性伦| 884aa四虎影成人精品一区| 日韩欧美专区在线| 国产亚洲精品bt天堂精选| 国产精品久久久久三级| 亚洲一区在线电影| 免费在线观看精品| 国产v日产∨综合v精品视频| 97久久精品人人做人人爽| 欧美日韩在线直播| 久久免费国产精品| 夜夜夜精品看看| 日韩电影免费一区| 粉嫩在线一区二区三区视频| 91久久奴性调教| 日韩欧美视频在线| 亚洲蜜桃精久久久久久久| 日韩电影在线观看网站| 成人激情黄色小说| 欧美一区二区性放荡片| 久久综合九色综合欧美98| 中文字幕综合网| 蜜桃精品在线观看| 91麻豆自制传媒国产之光| 制服丝袜日韩国产| 中文字幕在线不卡| 久久精品国产**网站演员| 波多野结衣的一区二区三区| 8x8x8国产精品| 亚洲女厕所小便bbb| 久久精品国产亚洲高清剧情介绍 | 图片区小说区区亚洲影院| 韩国午夜理伦三级不卡影院| 欧美综合亚洲图片综合区| 日本一区二区三区视频视频| 首页国产欧美久久| 99久久精品国产麻豆演员表| 日韩欧美在线影院| 婷婷综合另类小说色区| 92精品国产成人观看免费 | 色吊一区二区三区| 精品裸体舞一区二区三区| 亚洲国产精品一区二区www在线 | 99久久综合色| 久久精品视频免费观看| 免费人成精品欧美精品 | 国产麻豆精品95视频| 91精品国产91久久久久久最新毛片 | 老司机精品视频线观看86| 六月婷婷色综合| 欧美日韩在线播| 亚洲品质自拍视频| 成人精品国产福利| 日本一区二区综合亚洲| 久久国产视频网| 日韩午夜电影av| 日韩中文字幕不卡| 91精品国产色综合久久ai换脸| 一区二区三区色| 在线一区二区三区做爰视频网站| 国产精品久久毛片av大全日韩| 国产一区在线观看视频| 国产亚洲成av人在线观看导航| 韩国视频一区二区| 国产免费观看久久| 成人久久18免费网站麻豆 | k8久久久一区二区三区| 国产欧美一区二区精品忘忧草| 极品少妇一区二区| 国产亚洲欧美色| 豆国产96在线|亚洲| 中文字幕在线一区二区三区| aaa欧美日韩| 亚洲综合一区二区三区| 69堂成人精品免费视频| 看片的网站亚洲| 国产三级久久久| 色欧美日韩亚洲| 日韩国产精品久久| 久久综合九色综合欧美98| caoporn国产一区二区| 综合久久给合久久狠狠狠97色 | 免费欧美日韩国产三级电影| 精品人伦一区二区色婷婷| 国产成人自拍在线| 亚洲精品久久嫩草网站秘色| 欧美日韩一区小说| 国产精品1区2区3区| 国产精品久久久久久久久免费桃花 | 日韩美女在线视频| 成人精品国产一区二区4080| 亚洲国产日韩a在线播放性色| 欧美成人一区二区三区在线观看| 成人中文字幕电影| 亚欧色一区w666天堂| 久久久久久电影| 欧美色涩在线第一页| 国产精品一区二区三区四区| 一区二区三区中文字幕| 久久婷婷国产综合国色天香| 在线亚洲欧美专区二区| 国内一区二区在线| 五月激情六月综合| 欧美激情在线观看视频免费| 在线成人小视频| 97久久久精品综合88久久| 久久国产日韩欧美精品| 一区二区三区产品免费精品久久75| 精品免费一区二区三区| 欧美性视频一区二区三区| 高清在线观看日韩| 九九**精品视频免费播放| 亚洲大片在线观看| 欧美经典一区二区三区| 欧美一级精品在线| 欧美日韩一区二区电影| www.视频一区| 国产不卡一区视频| 国产一区二区三区av电影 | 久久久亚洲高清| 欧美一区二区精品在线| 91蜜桃免费观看视频| 国产精品18久久久久久vr| 喷白浆一区二区| 午夜久久电影网| 亚洲第一综合色| 亚洲欧美aⅴ...| 亚洲日本护士毛茸茸| 国产精品免费久久| 久久在线观看免费| 欧美www视频| 欧美不卡一区二区三区| 日韩一二三区视频| 日韩欧美成人激情| 欧美一区二区三级| 欧美精品日韩综合在线| 欧美男男青年gay1069videost| 91麻豆123| 欧美中文字幕不卡| 欧美日韩视频专区在线播放| 欧美色精品天天在线观看视频| 在线影视一区二区三区| 91丨porny丨首页| 日本黄色一区二区| 欧美男人的天堂一二区| 欧美一区二区三区性视频| 日韩一区二区在线看| 欧美日韩一区二区三区在线看| 欧美日韩1234| 日韩一级黄色片| 国产亚洲一区二区三区| 亚洲天堂久久久久久久| 一区二区三区在线免费| 天堂成人免费av电影一区| 蜜桃精品在线观看| 成人污污视频在线观看| 一本色道**综合亚洲精品蜜桃冫| 色妞www精品视频| 欧美剧情片在线观看| 欧美精品一区二区三区很污很色的| 久久久欧美精品sm网站| 国产精品久久久久久久第一福利| 一区二区视频免费在线观看| 丝袜国产日韩另类美女| 国产精品中文字幕日韩精品| av爱爱亚洲一区| 91精品在线一区二区| 久久久噜噜噜久久中文字幕色伊伊 | 91精品国产高清一区二区三区 | proumb性欧美在线观看| 欧美日韩色一区| 久久女同精品一区二区| 一区二区三区四区视频精品免费 | 美腿丝袜一区二区三区| 东方欧美亚洲色图在线| 欧美日韩精品一区二区三区| 久久精品一二三| 午夜精品久久久久久不卡8050| 久久精品免费观看| 色噜噜狠狠成人中文综合 | 欧美在线视频你懂得| 久久综合狠狠综合| 婷婷开心久久网| 91首页免费视频| 久久一区二区三区国产精品| 亚洲一二三级电影| 暴力调教一区二区三区|