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

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

?? os_q.c

?? 51單片機上移植UCOSII,通過調試
?? 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)LG_REENTRANT
{
#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)LG_REENTRANT
{
#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)LG_REENTRANT
{
#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)LG_REENTRANT
{
#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一区二区三区免费野_久草精品视频
麻豆精品蜜桃视频网站| 一区二区三区.www| 久久精品国产亚洲一区二区三区| 欧美日韩成人一区二区| 三级影片在线观看欧美日韩一区二区| 欧美性猛交xxxxxx富婆| 午夜不卡在线视频| 日韩午夜激情视频| 久久99精品国产| 国产清纯白嫩初高生在线观看91| 大桥未久av一区二区三区中文| 国产精品美日韩| 91免费版pro下载短视频| 亚洲国产一区二区三区| 欧美成人精品二区三区99精品| 国产精品自在在线| 亚洲人成电影网站色mp4| 欧美日韩午夜在线| 久久精品国产第一区二区三区| 国产午夜一区二区三区| 91污在线观看| 免费不卡在线视频| 国产精品你懂的| 欧美日韩一区高清| 九九国产精品视频| 国产精品九色蝌蚪自拍| 欧美日韩免费在线视频| 九九**精品视频免费播放| 日韩毛片视频在线看| 欧美日韩一区成人| 国产精品一卡二卡在线观看| 一区二区三区久久| 久久嫩草精品久久久精品| 91玉足脚交白嫩脚丫在线播放| 日韩不卡免费视频| 中文字幕色av一区二区三区| 欧美一区二区三区视频在线观看| 成人午夜av影视| 免费观看一级特黄欧美大片| 亚洲色图视频网| 精品国产污污免费网站入口| 欧美偷拍一区二区| 成人黄色小视频| 蜜臀99久久精品久久久久久软件| 亚洲天天做日日做天天谢日日欢| 日韩精品一区二区三区视频在线观看| 99精品一区二区三区| 日本成人在线一区| 一区二区三区在线看| 久久综合色播五月| 欧美一区二区三区电影| 色综合一区二区| 国产 欧美在线| 精品在线一区二区三区| 亚洲夂夂婷婷色拍ww47| 国产精品色婷婷| 欧美mv日韩mv| 欧美高清dvd| 欧美午夜精品免费| 99久久综合99久久综合网站| 国产一区二区福利视频| 蜜臀av一区二区三区| 亚洲成av人片| 亚洲影院久久精品| 亚洲免费av高清| 中文字幕在线不卡视频| 国产喷白浆一区二区三区| 日韩一区二区三区精品视频 | 国产亚洲成年网址在线观看| 欧美日韩不卡在线| 在线观看av不卡| 在线视频亚洲一区| 日本韩国一区二区三区视频| 91小视频免费观看| 色综合一区二区| 91社区在线播放| 91麻豆6部合集magnet| 成人高清视频在线| 成人av在线播放网站| 国产美女在线观看一区| 国内精品伊人久久久久av影院| 精品系列免费在线观看| 久久超级碰视频| 精品一区二区三区免费毛片爱 | 色播五月激情综合网| 99热精品一区二区| 欧美在线三级电影| 欧美日韩成人一区| 日韩欧美视频一区| 26uuu亚洲综合色欧美| 久久久亚洲午夜电影| 国产精品嫩草影院av蜜臀| 亚洲欧洲日韩女同| 亚洲一区二区五区| 日本强好片久久久久久aaa| 日韩精品成人一区二区三区| 蜜桃视频在线观看一区| 久久精品噜噜噜成人av农村| 韩国v欧美v日本v亚洲v| 成人av网址在线观看| 一本久久综合亚洲鲁鲁五月天| 色欧美片视频在线观看| 欧美无砖砖区免费| 久久综合狠狠综合久久激情| 欧美国产日韩在线观看| 亚洲综合一区二区精品导航| 青青草一区二区三区| 国产精品一区二区三区乱码| 北岛玲一区二区三区四区| 91黄色免费观看| 日韩欧美国产综合| 国产精品欧美久久久久一区二区| 亚洲一区欧美一区| 美女精品一区二区| 91亚洲精品一区二区乱码| 欧美日精品一区视频| 久久久蜜桃精品| 亚洲一级二级在线| 国产精品一区二区久久精品爱涩| 色视频一区二区| 久久青草国产手机看片福利盒子| 亚洲日本在线观看| 久久国产三级精品| 色婷婷久久久亚洲一区二区三区| 日韩亚洲欧美一区二区三区| 国产女主播在线一区二区| 亚洲国产欧美在线人成| 国产成人av一区二区三区在线| 欧美主播一区二区三区美女| 久久久久久日产精品| 亚洲丶国产丶欧美一区二区三区| 国产乱淫av一区二区三区| 在线免费观看成人短视频| 国产视频一区在线观看| 日韩av一级电影| 色综合色综合色综合| 久久人人超碰精品| 日本欧美大码aⅴ在线播放| 色婷婷综合久久久久中文一区二区 | 五月综合激情日本mⅴ| 成人性视频网站| 精品国产免费人成电影在线观看四季| 亚洲一区中文在线| 成人免费av资源| 精品少妇一区二区| 五月婷婷综合激情| 日本久久电影网| 亚洲欧洲日韩在线| 丁香婷婷综合色啪| 久久综合国产精品| 黄网站免费久久| 欧美大片日本大片免费观看| 亚洲国产精品精华液网站| 色94色欧美sute亚洲线路一久 | 午夜精品一区二区三区三上悠亚| 北条麻妃国产九九精品视频| 国产日韩欧美激情| 国产一区二区三区av电影| 日韩欧美在线123| 日韩精品乱码av一区二区| 欧美日韩国产一区二区三区地区| 亚洲精品国产第一综合99久久 | 亚洲成人免费在线观看| 日本乱人伦aⅴ精品| 亚洲老妇xxxxxx| 91激情五月电影| 亚洲国产精品自拍| 欧美日韩第一区日日骚| 日韩在线播放一区二区| 欧美高清视频www夜色资源网| 午夜电影网亚洲视频| 91麻豆精品国产自产在线观看一区| 亚洲国产精品综合小说图片区| 欧美三级欧美一级| 日韩国产成人精品| 91精品国产综合久久婷婷香蕉| 日韩福利视频网| 日韩精品一区二区三区老鸭窝| 看片的网站亚洲| 国产偷国产偷亚洲高清人白洁| 国产成人aaa| 亚洲欧美偷拍另类a∨色屁股| 色综合久久久久久久久| 一区二区三区国产精华| 欧美日韩免费不卡视频一区二区三区| 午夜精品久久一牛影视| 日韩精品影音先锋| 高清不卡一区二区| 亚洲综合精品自拍| 日韩欧美国产综合| zzijzzij亚洲日本少妇熟睡| 亚洲人成小说网站色在线| 欧美无人高清视频在线观看| 日本免费在线视频不卡一不卡二| 久久久噜噜噜久噜久久综合| 91丨porny丨国产入口| 午夜精品123| 国产视频一区在线观看 | 欧美日韩国产高清一区二区三区 | 亚洲精品乱码久久久久久黑人|