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

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

?? os_q.c

?? UCOS-II FOR STM32F103XX 1 本程序是我自己移植
?? C
?? 第 1 頁 / 共 3 頁
字號:
        return (OS_ERR_PEVENT_NULL);
    }
#endif
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {      /* Validate event block type                    */
        return (OS_ERR_EVENT_TYPE);
    }
    OS_ENTER_CRITICAL();
    if (pevent->OSEventGrp != 0) {                     /* See if any task pending on queue             */
                                                       /* Ready highest priority task waiting on event */
        (void)OS_EventTaskRdy(pevent, pmsg, OS_STAT_Q, OS_STAT_PEND_OK);
        OS_EXIT_CRITICAL();
        OS_Sched();                                    /* Find highest priority task ready to run      */
        return (OS_ERR_NONE);
    }
    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_ERR_Q_FULL);
    }
    *pq->OSQIn++ = pmsg;                               /* 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_ERR_NONE);
}
#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
*
*              pmsg          is a pointer to the message to send.
*
* Returns    : OS_ERR_NONE           The call was successful and the message was sent
*              OS_ERR_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
*
* Note(s)    : As of V2.60, this function allows you to send NULL pointer messages.
*********************************************************************************************************
*/

#if OS_Q_POST_FRONT_EN > 0
INT8U  OSQPostFront (OS_EVENT *pevent, 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 (pevent == (OS_EVENT *)0) {                    /* Validate 'pevent'                             */
        return (OS_ERR_PEVENT_NULL);
    }
#endif
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {     /* Validate event block type                     */
        return (OS_ERR_EVENT_TYPE);
    }
    OS_ENTER_CRITICAL();
    if (pevent->OSEventGrp != 0) {                    /* See if any task pending on queue              */
                                                      /* Ready highest priority task waiting on event  */
        (void)OS_EventTaskRdy(pevent, pmsg, OS_STAT_Q, OS_STAT_PEND_OK);
        OS_EXIT_CRITICAL();
        OS_Sched();                                   /* Find highest priority task ready to run       */
        return (OS_ERR_NONE);
    }
    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_ERR_Q_FULL);
    }
    if (pq->OSQOut == pq->OSQStart) {                 /* Wrap OUT ptr if we are at the 1st queue entry */
        pq->OSQOut = pq->OSQEnd;
    }
    pq->OSQOut--;
    *pq->OSQOut = pmsg;                               /* Insert message into queue                     */
    pq->OSQEntries++;                                 /* Update the nbr of entries in the queue        */
    OS_EXIT_CRITICAL();
    return (OS_ERR_NONE);
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                        POST MESSAGE TO A QUEUE
*
* Description: This function sends a message to a queue.  This call has been added to reduce code size
*              since it can replace both OSQPost() and OSQPostFront().  Also, this function adds the
*              capability to broadcast a message to ALL tasks waiting on the message queue.
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired queue
*
*              pmsg          is a pointer to the message to send.
*
*              opt           determines the type of POST performed:
*                            OS_POST_OPT_NONE         POST to a single waiting task
*                                                     (Identical to OSQPost())
*                            OS_POST_OPT_BROADCAST    POST to ALL tasks that are waiting on the queue
*                            OS_POST_OPT_FRONT        POST as LIFO (Simulates OSQPostFront())
*                            OS_POST_OPT_NO_SCHED     Indicates that the scheduler will NOT be invoked
*
* Returns    : OS_ERR_NONE           The call was successful and the message was sent
*              OS_ERR_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
*
* Warning    : Interrupts can be disabled for a long time if you do a 'broadcast'.  In fact, the
*              interrupt disable time is proportional to the number of tasks waiting on the queue.
*********************************************************************************************************
*/

#if OS_Q_POST_OPT_EN > 0
INT8U  OSQPostOpt (OS_EVENT *pevent, void *pmsg, INT8U opt)
{
    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 (pevent == (OS_EVENT *)0) {                    /* Validate 'pevent'                             */
        return (OS_ERR_PEVENT_NULL);
    }
#endif
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {     /* Validate event block type                     */
        return (OS_ERR_EVENT_TYPE);
    }
    OS_ENTER_CRITICAL();
    if (pevent->OSEventGrp != 0x00) {                 /* See if any task pending on queue              */
        if ((opt & OS_POST_OPT_BROADCAST) != 0x00) {  /* Do we need to post msg to ALL waiting tasks ? */
            while (pevent->OSEventGrp != 0) {         /* Yes, Post to ALL tasks waiting on queue       */
                (void)OS_EventTaskRdy(pevent, pmsg, OS_STAT_Q, OS_STAT_PEND_OK);
            }
        } else {                                      /* No,  Post to HPT waiting on queue             */
            (void)OS_EventTaskRdy(pevent, pmsg, OS_STAT_Q, OS_STAT_PEND_OK);
        }
        OS_EXIT_CRITICAL();
        if ((opt & OS_POST_OPT_NO_SCHED) == 0) {	  /* See if scheduler needs to be invoked          */
            OS_Sched();                               /* Find highest priority task ready to run       */
        }
        return (OS_ERR_NONE);
    }
    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_ERR_Q_FULL);
    }
    if ((opt & OS_POST_OPT_FRONT) != 0x00) {          /* Do we post to the FRONT of the queue?         */
        if (pq->OSQOut == pq->OSQStart) {             /* Yes, Post as LIFO, Wrap OUT pointer if we ... */
            pq->OSQOut = pq->OSQEnd;                  /*      ... are at the 1st queue entry           */
        }
        pq->OSQOut--;
        *pq->OSQOut = pmsg;                           /*      Insert message into queue                */
    } else {                                          /* No,  Post as FIFO                             */
        *pq->OSQIn++ = pmsg;                          /*      Insert message into queue                */
        if (pq->OSQIn == pq->OSQEnd) {                /*      Wrap IN ptr if we are at end of queue    */
            pq->OSQIn = pq->OSQStart;
        }
    }
    pq->OSQEntries++;                                 /* Update the nbr of entries in the queue        */
    OS_EXIT_CRITICAL();
    return (OS_ERR_NONE);
}
#endif
/*$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 queue
*
*              p_q_data      is a pointer to a structure that will contain information about the message
*                            queue.
*
* Returns    : OS_ERR_NONE         The call was successful and the message was sent
*              OS_ERR_EVENT_TYPE   If you are attempting to obtain data from a non queue.
*              OS_ERR_PEVENT_NULL  If 'pevent'   is a NULL pointer
*              OS_ERR_PDATA_NULL   If 'p_q_data' is a NULL pointer
*********************************************************************************************************
*/

#if OS_Q_QUERY_EN > 0
INT8U  OSQQuery (OS_EVENT *pevent, OS_Q_DATA *p_q_data)
{
    OS_Q      *pq;
    INT8U      i;
#if OS_LOWEST_PRIO <= 63
    INT8U     *psrc;
    INT8U     *pdest;
#else
    INT16U    *psrc;
    INT16U    *pdest;
#endif
#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 (pevent == (OS_EVENT *)0) {                     /* Validate 'pevent'                            */
        return (OS_ERR_PEVENT_NULL);
    }
    if (p_q_data == (OS_Q_DATA *)0) {                  /* Validate 'p_q_data'                          */
        return (OS_ERR_PDATA_NULL);
    }
#endif
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {      /* Validate event block type                    */
        return (OS_ERR_EVENT_TYPE);
    }
    OS_ENTER_CRITICAL();
    p_q_data->OSEventGrp = pevent->OSEventGrp;         /* Copy message queue wait list                 */
    psrc                 = &pevent->OSEventTbl[0];
    pdest                = &p_q_data->OSEventTbl[0];
    for (i = 0; i < OS_EVENT_TBL_SIZE; i++) {
        *pdest++ = *psrc++;
    }
    pq = (OS_Q *)pevent->OSEventPtr;
    if (pq->OSQEntries > 0) {
        p_q_data->OSMsg = *pq->OSQOut;                 /* Get next message to return if available      */
    } else {
        p_q_data->OSMsg = (void *)0;
    }
    p_q_data->OSNMsgs = pq->OSQEntries;
    p_q_data->OSQSize = pq->OSQSize;
    OS_EXIT_CRITICAL();
    return (OS_ERR_NONE);
}
#endif                                                 /* OS_Q_QUERY_EN                                */

/*$PAGE*/
/*
*********************************************************************************************************
*                                      QUEUE MODULE INITIALIZATION
*
* Description : This function is called by uC/OS-II to initialize the message queue module.  Your
*               application MUST NOT call this function.
*
* Arguments   :  none
*
* Returns     : none
*
* Note(s)    : This function is INTERNAL to uC/OS-II and your application should not call it.
*********************************************************************************************************
*/

void  OS_QInit (void)
{
#if OS_MAX_QS == 1
    OSQFreeList         = &OSQTbl[0];                /* Only ONE queue!                                */
    OSQFreeList->OSQPtr = (OS_Q *)0;
#endif

#if OS_MAX_QS >= 2
    INT16U  i;
    OS_Q   *pq1;
    OS_Q   *pq2;



    OS_MemClr((INT8U *)&OSQTbl[0], sizeof(OSQTbl));  /* Clear the queue table                          */
    pq1 = &OSQTbl[0];
    pq2 = &OSQTbl[1];
    for (i = 0; i < (OS_MAX_QS - 1); i++) {          /* Init. list of free QUEUE control blocks        */
        pq1->OSQPtr = pq2;
        pq1++;
        pq2++;
    }
    pq1->OSQPtr = (OS_Q *)0;
    OSQFreeList = &OSQTbl[0];
#endif
}
#endif                                               /* OS_Q_EN                                        */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色94色欧美sute亚洲13| 亚洲精品五月天| 日韩一区二区电影在线| 91精品91久久久中77777| 91视频一区二区| av中文字幕在线不卡| 岛国av在线一区| 不卡一区二区在线| 欧洲视频一区二区| 欧美日韩国产乱码电影| 欧美裸体一区二区三区| 欧美一区午夜精品| 精品国产乱码久久久久久浪潮| 日韩欧美一区二区视频| 久久婷婷国产综合国色天香 | 国产精品久久久久9999吃药| 国产欧美一区二区在线观看| 中文字幕在线不卡| 午夜精品久久久久久不卡8050| 日韩和的一区二区| 国产精品资源网| 91丝袜美腿高跟国产极品老师| 欧美性做爰猛烈叫床潮| 欧美tickling挠脚心丨vk| 国产清纯白嫩初高生在线观看91 | 成人中文字幕合集| 99久久国产综合精品色伊| 色老汉av一区二区三区| 精品国产一区二区三区不卡| 色哟哟在线观看一区二区三区| 欧美视频在线观看一区二区| 日韩一区二区电影网| 亚洲丝袜另类动漫二区| 日本午夜一区二区| 99r精品视频| 日韩欧美一区二区在线视频| 日韩毛片一二三区| 蜜臂av日日欢夜夜爽一区| 成人av电影在线| 欧美一区二区三区视频在线| 自拍偷拍亚洲激情| 激情深爱一区二区| 欧美日韩精品一区二区在线播放| 国产亚洲人成网站| 日韩av一区二区三区四区| 成人av电影在线观看| 精品久久久久久久久久久久包黑料| 国产精品久久久久9999吃药| 久久99久久99精品免视看婷婷| 91香蕉视频污| 国产欧美精品在线观看| 美女高潮久久久| 欧美日韩一级视频| 亚洲丝袜制服诱惑| www.日韩在线| 欧美韩国日本综合| 精品午夜久久福利影院| 欧美日韩免费一区二区三区视频| 国产精品久久久久三级| 国产自产视频一区二区三区| 欧美精品18+| 婷婷综合五月天| 精品视频在线免费| 一区二区三区不卡视频 | 亚洲国产精品ⅴa在线观看| 男女性色大片免费观看一区二区| 在线观看日韩电影| 亚洲裸体xxx| 91麻豆免费观看| 日韩理论片在线| 色综合天天综合网天天看片| 国产精品视频yy9299一区| 国产伦精品一区二区三区免费迷| 欧美电影免费观看高清完整版在线观看| 亚洲777理论| 欧美日本乱大交xxxxx| 亚洲国产一区二区三区| 欧美亚洲国产一区二区三区| 亚洲综合av网| 欧美日韩一区 二区 三区 久久精品| 亚洲乱码中文字幕| 欧美理论片在线| 秋霞影院一区二区| 久久久一区二区| 国产91在线|亚洲| 日韩理论片中文av| 欧美日韩激情一区| 免费观看成人鲁鲁鲁鲁鲁视频| www激情久久| jlzzjlzz亚洲女人18| 亚洲天堂av老司机| 欧美日韩高清在线播放| 蜜桃视频一区二区| 国产色产综合产在线视频| 国产91露脸合集magnet| 亚洲欧洲一区二区三区| 欧美亚洲综合久久| 精品一区二区久久久| 国产精品日产欧美久久久久| 色综合网色综合| 久久精品国产精品亚洲精品| 中文字幕第一区| 欧美日韩一区二区三区免费看| 激情成人综合网| 亚洲欧美中日韩| 91精品国产乱| 成年人午夜久久久| 日本在线不卡视频一二三区| 国产免费观看久久| 欧美猛男超大videosgay| 久久69国产一区二区蜜臀| 1000部国产精品成人观看| 在线成人av影院| 91色视频在线| 韩国成人福利片在线播放| 亚洲欧美另类图片小说| 欧美videofree性高清杂交| aaa欧美色吧激情视频| 免费在线观看日韩欧美| 综合在线观看色| 日韩精品专区在线影院观看| 91在线视频播放| 国产成人精品1024| 日韩电影在线一区| 亚洲影院在线观看| 国产精品女同一区二区三区| 日韩欧美综合一区| 欧美日韩mp4| 在线视频中文字幕一区二区| 国产精品自在欧美一区| 日韩综合一区二区| 一区二区三区日韩在线观看| 国产女人aaa级久久久级 | 欧美人妇做爰xxxⅹ性高电影| 国产精品一区不卡| 日本 国产 欧美色综合| 亚洲国产精品影院| 亚洲色图欧美在线| 国产精品久久99| 欧美极品另类videosde| 26uuu成人网一区二区三区| 91精品国产一区二区人妖| 欧美性色综合网| 欧美日韩夫妻久久| 欧美日韩大陆一区二区| 欧美视频三区在线播放| 色婷婷av一区二区三区大白胸| 91亚洲精品乱码久久久久久蜜桃 | 亚洲精品视频在线看| 中文av一区特黄| 国产精品全国免费观看高清| 国产情人综合久久777777| 久久蜜桃一区二区| 久久久不卡影院| 中文子幕无线码一区tr| 欧美激情一区二区三区在线| 欧美激情一区二区三区在线| 中文字幕国产一区| 亚洲欧美中日韩| 亚洲黄色录像片| 一区二区高清在线| 亚洲成年人影院| 轻轻草成人在线| 国产中文字幕精品| 成人中文字幕合集| 91国偷自产一区二区使用方法| 欧美色综合网站| 欧美一区二区三区视频免费| 欧美精品一区二区三区很污很色的| 久久婷婷国产综合精品青草| 国产精品色婷婷久久58| 亚洲久草在线视频| 日本在线不卡视频| 国产一区二区影院| 91亚洲国产成人精品一区二区三| 欧美日韩亚洲高清一区二区| 日韩欧美专区在线| 中文字幕在线一区免费| 艳妇臀荡乳欲伦亚洲一区| 日本一区中文字幕| 懂色一区二区三区免费观看| 色综合色狠狠天天综合色| 欧美性高清videossexo| 日韩欧美国产一区二区三区| 欧美激情综合五月色丁香| 亚洲成人午夜影院| 国产69精品久久久久毛片| 91国产免费看| 久久精品视频在线免费观看| 亚洲私人影院在线观看| 久久精品免费看| 色综合久久99| 久久这里只精品最新地址| 亚洲欧美日韩成人高清在线一区| 麻豆91在线播放| 在线一区二区三区四区| xf在线a精品一区二区视频网站| 亚洲精品老司机| 粉嫩嫩av羞羞动漫久久久| 欧美伦理视频网站|