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

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

?? os_q.c

?? AVR單片機(jī)上的ucOS-II V2.76的移植,編譯器為WINAVR,G
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
#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              */
        (void)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);
    }
    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);
}
#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
*
*              msg           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())
*
*                            Below is a list of ALL the possible combination of these flags:
*
*                                 1) OS_POST_OPT_NONE
*                                    identical to OSQPost()
*
*                                 2) OS_POST_OPT_FRONT
*                                    identical to OSQPostFront()
*
*                                 3) OS_POST_OPT_BROADCAST
*                                    identical to OSQPost() but will broadcast 'msg' to ALL waiting tasks
*
*                                 4) OS_POST_OPT_FRONT + OS_POST_OPT_BROADCAST  is identical to
*                                    OSQPostFront() except that will broadcast 'msg' to ALL waiting tasks
*
* 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
*
* 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 *msg, INT8U opt)
{
    OS_Q      *pq;
#if OS_CRITICAL_METHOD == 3                           /* Allocate storage for CPU status register      */
    OS_CPU_SR  cpu_sr;
                     


    cpu_sr = 0;                                       /* Prevent compiler warning                      */
#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 != 0x00) {      /* Yes, Post to ALL tasks waiting on queue       */
                (void)OS_EventTaskRdy(pevent, msg, OS_STAT_Q);
            }
        } else {
            (void)OS_EventTaskRdy(pevent, msg, OS_STAT_Q);  /* No,  Post to HPT waiting on queue       */
        }
        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);
    }
    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 = msg;                            /*      Insert message into queue                */
    } else {                                          /* No,  Post as FIFO                             */
        *pq->OSQIn++ = msg;                           /*      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_NO_ERR);
}
#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_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.
*              OS_ERR_PEVENT_NULL  If 'pevent' 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     *psrc;
    INT8U     *pdest;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;



    cpu_sr = 0;                                            /* Prevent compiler warning                 */
#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();
    p_q_data->OSEventGrp = pevent->OSEventGrp;             /* Copy message queue wait list             */
    psrc                 = &pevent->OSEventTbl[0];
    pdest                = &p_q_data->OSEventTbl[0];
#if OS_EVENT_TBL_SIZE > 0
    *pdest++ = *psrc++;
#endif

#if OS_EVENT_TBL_SIZE > 1
    *pdest++ = *psrc++;
#endif

#if OS_EVENT_TBL_SIZE > 2
    *pdest++ = *psrc++;
#endif

#if OS_EVENT_TBL_SIZE > 3
    *pdest++ = *psrc++;
#endif

#if OS_EVENT_TBL_SIZE > 4
    *pdest++ = *psrc++;
#endif

#if OS_EVENT_TBL_SIZE > 5
    *pdest++ = *psrc++;
#endif

#if OS_EVENT_TBL_SIZE > 6
    *pdest++ = *psrc++;
#endif

#if OS_EVENT_TBL_SIZE > 7
    *pdest   = *psrc;
#endif
    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_NO_ERR);
}
#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                                        */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人在线免费| 成人免费看黄yyy456| 久久久久久免费网| 欧美主播一区二区三区| 久久99精品久久久久久国产越南| 亚洲免费色视频| 26uuu久久综合| 欧美亚洲一区二区在线观看| 粉嫩在线一区二区三区视频| 男女男精品网站| 亚洲午夜精品久久久久久久久| 国产午夜三级一区二区三| 欧美精品免费视频| 91天堂素人约啪| 国产91精品一区二区麻豆亚洲| 青青草国产精品亚洲专区无| 一区二区三区日韩| 中文字幕中文字幕在线一区| 久久久综合精品| 日韩一区国产二区欧美三区| 在线观看亚洲精品视频| 不卡欧美aaaaa| 国产成人免费在线观看| 久久99精品久久久久久国产越南 | 午夜影院在线观看欧美| 欧美国产欧美综合| 欧美变态tickling挠脚心| 欧美三级乱人伦电影| 色综合天天做天天爱| 丁香啪啪综合成人亚洲小说 | 26uuu亚洲综合色| 日韩视频免费观看高清完整版在线观看 | 天天综合天天综合色| 亚洲激情自拍视频| 亚洲欧洲制服丝袜| 亚洲三级视频在线观看| 中文字幕在线不卡国产视频| 国产日产欧美一区二区三区| 精品电影一区二区三区| 欧美va在线播放| 欧美videos中文字幕| 日韩一区二区三| 日韩精品一区二区三区蜜臀 | 国产精品水嫩水嫩| 国产欧美一区在线| 中文字幕精品综合| 国产精品电影一区二区三区| 最新日韩在线视频| 亚洲免费色视频| 亚洲一区二区五区| 午夜一区二区三区视频| 日韩黄色免费电影| 捆绑调教美女网站视频一区| 国产在线不卡一区| 成人免费视频播放| 91视频在线观看免费| 欧美中文字幕一区二区三区| 久久精品夜色噜噜亚洲aⅴ| 国产日韩欧美不卡在线| 亚洲欧洲综合另类| 亚洲国产wwwccc36天堂| 秋霞电影网一区二区| 久久电影国产免费久久电影| 国产成人丝袜美腿| 97久久超碰精品国产| 91成人网在线| 91精品国产综合久久婷婷香蕉 | 91精品蜜臀在线一区尤物| 日韩欧美亚洲一区二区| 久久欧美一区二区| 1024成人网色www| 午夜精品aaa| 国产美女精品人人做人人爽| 99久久精品免费看| 欧美日韩国产首页在线观看| 精品国产精品网麻豆系列| 国产女主播在线一区二区| 亚洲毛片av在线| 美女精品自拍一二三四| 成人精品视频网站| 欧美日韩国产综合久久| 国产亚洲一区二区三区四区| 亚洲精品美腿丝袜| 久久99在线观看| 97精品久久久久中文字幕| 欧美一区二区三区免费| 国产精品萝li| 青青草伊人久久| www.久久久久久久久| 欧美丰满高潮xxxx喷水动漫| 精品国产凹凸成av人导航| 亚洲免费观看在线观看| 欧美日韩不卡一区二区| 久久众筹精品私拍模特| 一区二区三区四区乱视频| 国产一区欧美二区| 欧美日韩国产一区二区三区地区| 国产喂奶挤奶一区二区三区| 午夜久久电影网| eeuss影院一区二区三区| 欧美一级淫片007| 亚洲裸体在线观看| 国产成人欧美日韩在线电影| 欧美一区二区在线免费播放| 亚洲欧美日韩国产一区二区三区| 精品一区二区免费在线观看| 欧美日本在线视频| **欧美大码日韩| 高清不卡一二三区| 日韩精品最新网址| 亚洲成a人片综合在线| 不卡影院免费观看| 久久日韩精品一区二区五区| 亚洲123区在线观看| 91网站最新地址| 国产精品三级在线观看| 激情综合网天天干| 精品1区2区3区| 亚洲精品日韩综合观看成人91| 国产69精品一区二区亚洲孕妇| 日韩区在线观看| 日韩激情在线观看| 欧美日韩一区二区三区四区五区| 亚洲色图制服丝袜| 成人免费高清视频在线观看| 久久久亚洲国产美女国产盗摄| 乱一区二区av| 亚洲国产精品自拍| 91麻豆免费观看| 综合色天天鬼久久鬼色| 成人av在线播放网站| 久久这里只有精品6| 久久99久久99小草精品免视看| 69堂成人精品免费视频| 日韩电影免费在线看| 欧美高清精品3d| 亚洲成av人影院| 69堂成人精品免费视频| 亚洲成人av电影| 5月丁香婷婷综合| 日韩国产欧美在线播放| 91精品国产一区二区三区蜜臀 | 男男成人高潮片免费网站| 欧美日韩一级黄| 天天色综合天天| 91精品国产一区二区三区蜜臀 | 一区二区三区欧美亚洲| 色婷婷av一区二区三区软件| 亚洲精品中文字幕在线观看| 色成人在线视频| 午夜a成v人精品| 日韩丝袜美女视频| 国产在线视视频有精品| 精品国产一区二区三区久久久蜜月| 美美哒免费高清在线观看视频一区二区| 欧美一级久久久| 国产成人高清在线| 亚洲品质自拍视频| 欧美精品三级在线观看| 久久99精品久久久久久| 国产三级精品三级| 91网站最新地址| 亚洲在线观看免费视频| 欧美高清激情brazzers| 狠狠色狠狠色合久久伊人| 国产欧美日韩综合精品一区二区| 成av人片一区二区| 91亚洲精品一区二区乱码| 一级日本不卡的影视| 88在线观看91蜜桃国自产| 国产九色精品成人porny| 中文字幕欧美一区| 欧美日韩在线播放三区四区| 美国精品在线观看| 欧美激情艳妇裸体舞| 欧美在线视频日韩| 精品午夜久久福利影院| 国产精品久久久久精k8| 欧美疯狂性受xxxxx喷水图片| 久久精品国产一区二区三区免费看| 国产无人区一区二区三区| 在线精品亚洲一区二区不卡| 毛片av中文字幕一区二区| 亚洲欧洲美洲综合色网| 91精品一区二区三区在线观看| 国产成人精品免费| 视频精品一区二区| 国产精品热久久久久夜色精品三区| 欧美日韩精品专区| 国产成人免费9x9x人网站视频| 亚洲成人福利片| 国产精品久久久久9999吃药| 欧美一级一级性生活免费录像| av在线播放成人| 国产综合色视频| 亚洲成人7777| 中文字幕一区二区三区在线播放 | 视频一区中文字幕国产| 国产精品短视频| 精品国内二区三区|