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

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

?? os_mbox.c

?? 基于uCOS-II 的MMC/SD卡的讀寫源程序
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
        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_MBOX) {  /* Validate event block type                     */
        *err = OS_ERR_EVENT_TYPE;
        return ((void *)0);
    }
#endif
    OS_ENTER_CRITICAL();
    msg = pevent->OSEventPtr;
    if (msg != (void *)0) {                           /* See if there is already a message             */
        pevent->OSEventPtr = (void *)0;               /* Clear the mailbox                             */
        OS_EXIT_CRITICAL();
        *err = OS_NO_ERR;
        return (msg);                                 /* Return the message received (or NULL)         */
    }
    OSTCBCur->OSTCBStat |= OS_STAT_MBOX;              /* Message not available, task will pend         */
    OSTCBCur->OSTCBDly   = timeout;                   /* Load timeout in 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) {                           /* See if we were given the message              */
        OSTCBCur->OSTCBMsg      = (void *)0;          /* Yes, clear message received                   */
        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 the message received                   */
    }
    OS_EventTO(pevent);                               /* Timed out, Make task ready                    */
    OS_EXIT_CRITICAL();
    *err = OS_TIMEOUT;                                /* Indicate that a timeout occured               */
    return ((void *)0);                               /* Return a NULL message                         */
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                       POST MESSAGE TO A MAILBOX
*
* Description: This function sends a message to a mailbox
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired mailbox
*
*              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_MBOX_FULL         If the mailbox already contains a message.  You can can only send one
*                                   message at a time and thus, the message MUST be consumed before you
*                                   are allowed to send another one.
*              OS_ERR_EVENT_TYPE    If you are attempting to post to a non mailbox.
*              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_MBOX_POST_EN > 0
INT8U  OSMboxPost (OS_EVENT *pevent, void *msg)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    
    
#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_MBOX) {  /* Validate event block type                     */
        return (OS_ERR_EVENT_TYPE);
    }
#endif
    OS_ENTER_CRITICAL();
    if (pevent->OSEventGrp != 0x00) {                 /* See if any task pending on mailbox            */
        OS_EventTaskRdy(pevent, msg, OS_STAT_MBOX);   /* Ready highest priority task waiting on event  */
        OS_EXIT_CRITICAL();
        OS_Sched();                                   /* Find highest priority task ready to run       */
        return (OS_NO_ERR);
    }
    if (pevent->OSEventPtr != (void *)0) {            /* Make sure mailbox doesn't already have a msg  */
        OS_EXIT_CRITICAL();
        return (OS_MBOX_FULL);
    }
    pevent->OSEventPtr = msg;                         /* Place message in mailbox                      */
    OS_EXIT_CRITICAL();
    return (OS_NO_ERR);
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                       POST MESSAGE TO A MAILBOX
*
* Description: This function sends a message to a mailbox
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired mailbox
*
*              msg           is a pointer to the message to send.  You MUST NOT send a NULL pointer.
*
*              opt           determines the type of POST performed:
*                            OS_POST_OPT_NONE         POST to a single waiting task 
*                                                     (Identical to OSMboxPost())
*                            OS_POST_OPT_BROADCAST    POST to ALL tasks that are waiting on the mailbox
*
* Returns    : OS_NO_ERR            The call was successful and the message was sent
*              OS_MBOX_FULL         If the mailbox already contains a message.  You can can only send one
*                                   message at a time and thus, the message MUST be consumed before you
*                                   are allowed to send another one.
*              OS_ERR_EVENT_TYPE    If you are attempting to post to a non mailbox.
*              OS_ERR_PEVENT_NULL   If 'pevent' is a NULL pointer
*              OS_ERR_POST_NULL_PTR If you are attempting to post 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 mailbox.
*********************************************************************************************************
*/

#if OS_MBOX_POST_OPT_EN > 0
INT8U  OSMboxPostOpt (OS_EVENT *pevent, void *msg, INT8U opt)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    
    
#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_MBOX) {  /* Validate event block type                     */
        return (OS_ERR_EVENT_TYPE);
    }
#endif
    OS_ENTER_CRITICAL();
    if (pevent->OSEventGrp != 0x00) {                 /* See if any task pending on mailbox            */
        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 mailbox     */           
                OS_EventTaskRdy(pevent, msg, OS_STAT_MBOX);    
            }
        } else {
            OS_EventTaskRdy(pevent, msg, OS_STAT_MBOX);    /* No,  Post to HPT waiting on mbox         */
        }
        OS_EXIT_CRITICAL();
        OS_Sched();                                        /* Find highest priority task ready to run  */
        return (OS_NO_ERR);
    }
    if (pevent->OSEventPtr != (void *)0) {            /* Make sure mailbox doesn't already have a msg  */
        OS_EXIT_CRITICAL();
        return (OS_MBOX_FULL);
    }
    pevent->OSEventPtr = msg;                         /* Place message in mailbox                      */
    OS_EXIT_CRITICAL();
    return (OS_NO_ERR);
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                        QUERY A MESSAGE MAILBOX
*
* Description: This function obtains information about a message mailbox.
*
* 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
*                            mailbox.
*
* 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 mailbox.
*              OS_ERR_PEVENT_NULL  If 'pevent' is a NULL pointer
*********************************************************************************************************
*/

#if OS_MBOX_QUERY_EN > 0
INT8U  OSMboxQuery (OS_EVENT *pevent, OS_MBOX_DATA *pdata)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    INT8U     *psrc;
    INT8U     *pdest;


#if OS_ARG_CHK_EN > 0
    if (pevent == (OS_EVENT *)0) {                         /* Validate 'pevent'                        */
        return (OS_ERR_PEVENT_NULL);
    }
    if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) {       /* Validate event block type                */
        return (OS_ERR_EVENT_TYPE);
    }
#endif
    OS_ENTER_CRITICAL();
    pdata->OSEventGrp = pevent->OSEventGrp;                /* Copy message mailbox wait list           */
    psrc              = &pevent->OSEventTbl[0];
    pdest             = &pdata->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
    pdata->OSMsg = pevent->OSEventPtr;                     /* Get message from mailbox                 */
    OS_EXIT_CRITICAL();
    return (OS_NO_ERR);
}
#endif                                                     /* OS_MBOX_QUERY_EN                         */
#endif                                                     /* OS_MBOX_EN                               */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色婷婷综合久久久久中文一区二区| 午夜欧美在线一二页| 亚洲欧美综合网| 一区二区三区欧美激情| 日韩国产高清在线| 国产精品12区| 色激情天天射综合网| 欧美一区二区三区成人| 中文字幕不卡在线| 亚洲伊人色欲综合网| 久久精品久久99精品久久| 成人午夜激情视频| 欧美裸体一区二区三区| 久久久欧美精品sm网站| 亚洲欧美国产77777| 免费日本视频一区| 成人午夜av在线| 欧美日韩不卡在线| 国产女人18水真多18精品一级做| 亚洲综合在线视频| 黄色成人免费在线| 91精品办公室少妇高潮对白| 精品国产乱码久久久久久久| 亚洲精品老司机| 国产精品亚洲专一区二区三区 | 精品福利一区二区三区免费视频| 中文字幕精品一区二区精品绿巨人 | 偷窥少妇高潮呻吟av久久免费| 国产一区高清在线| 精品视频在线免费看| 国产精品三级av| 日本欧美久久久久免费播放网| 99精品欧美一区| 26uuu国产日韩综合| 亚洲最大成人综合| 成人小视频在线观看| 日韩精品一区二区三区视频播放| 亚洲一区二区在线观看视频| 成人午夜免费视频| 久久一区二区三区国产精品| 日韩精品一级二级| 色综合久久综合网| 亚洲国产成人私人影院tom| 免费日本视频一区| 欧美性色欧美a在线播放| 欧美高清在线一区二区| 麻豆精品视频在线观看免费 | 五月开心婷婷久久| 91视频免费播放| 国产欧美日韩卡一| 久久99精品久久久久久动态图| 欧美日韩中文字幕精品| 亚洲丝袜另类动漫二区| 国产91丝袜在线播放九色| 日韩欧美成人一区| 日韩精品91亚洲二区在线观看| 色婷婷一区二区| 国产精品久久午夜夜伦鲁鲁| 国产成人亚洲综合a∨婷婷图片| 日韩欧美国产麻豆| 免费成人av在线播放| 欧美人牲a欧美精品| 亚洲国产精品久久久久婷婷884| 色吧成人激情小说| 国产精品美女久久久久久2018| 国产成人高清在线| 久久精品人人爽人人爽| 韩国视频一区二区| 久久影视一区二区| 国产乱人伦偷精品视频不卡| 久久久久国产精品麻豆| 国产一区二三区好的| 久久久影视传媒| 国产成人亚洲精品狼色在线 | 色综合天天综合给合国产| 成人免费视频在线观看| 91美女视频网站| 亚洲乱码一区二区三区在线观看| 91网站在线播放| 一区二区三区在线免费观看 | 日本中文字幕一区| 制服丝袜亚洲精品中文字幕| 麻豆国产欧美一区二区三区| 精品国产一区久久| 国产精品一区二区果冻传媒| 欧美国产欧美亚州国产日韩mv天天看完整 | 色香蕉久久蜜桃| 亚洲一区二区三区视频在线播放| 欧美亚一区二区| 日韩专区欧美专区| 欧美一二三四区在线| 国产在线精品免费av| 国产日产亚洲精品系列| 99久免费精品视频在线观看| 亚洲精品免费播放| 在线播放亚洲一区| 久久99精品久久只有精品| 国产亚洲va综合人人澡精品| 91社区在线播放| 亚洲va欧美va人人爽| 欧美一区二区啪啪| 国产一区91精品张津瑜| 亚洲视频狠狠干| 欧美日韩电影在线| 国产综合一区二区| 国产精品第四页| 欧美日韩成人一区| 国产综合色精品一区二区三区| 亚洲欧洲日韩女同| 欧美日韩国产三级| 国产在线精品一区二区夜色 | 国产一区二区三区国产| 国产精品乱码一区二区三区软件 | 一区二区三区欧美亚洲| 欧美一区午夜视频在线观看 | 亚洲精品日韩专区silk| 9191精品国产综合久久久久久| 国产一区在线观看视频| 亚洲乱码国产乱码精品精的特点| 欧美高清性hdvideosex| 国产精品综合一区二区| 亚洲欧美视频一区| 精品久久五月天| 欧美在线一区二区| 国产一区二区0| 亚洲国产成人porn| 久久精品人人做人人综合| 欧洲亚洲国产日韩| 国产呦精品一区二区三区网站| 亚洲自拍偷拍图区| 久久久亚洲欧洲日产国码αv| 91官网在线免费观看| 久久国产精品第一页| 亚洲免费高清视频在线| 亚洲精品在线免费播放| 欧洲一区在线电影| 成人一区在线看| 另类欧美日韩国产在线| 亚洲视频免费看| 久久精品日韩一区二区三区| 91麻豆精品国产| 一本一道综合狠狠老| 国产精品系列在线观看| 偷拍亚洲欧洲综合| 亚洲欧美日本在线| 国产日韩精品一区二区三区| 日韩午夜激情视频| 91黄色免费看| 成人免费观看男女羞羞视频| 狠狠狠色丁香婷婷综合激情| 视频在线在亚洲| 亚洲伦理在线精品| 中文字幕精品—区二区四季| 欧美精品一区二区不卡| 欧美日韩亚洲不卡| 91免费版在线| av男人天堂一区| 国产成人综合在线| 美女视频黄久久| 亚洲bdsm女犯bdsm网站| 亚洲精品日日夜夜| 国产精品久久久久婷婷| 久久久一区二区| 欧美zozo另类异族| 日韩一区二区三区精品视频 | 麻豆国产欧美日韩综合精品二区| 亚洲天堂网中文字| 欧美激情资源网| 国产午夜精品理论片a级大结局| 亚洲精品一区二区三区影院| 欧美一区二区在线看| 欧美精品在线一区二区| 在线精品视频一区二区三四| 99r国产精品| 91香蕉视频mp4| 91在线视频官网| 97国产一区二区| 97se亚洲国产综合自在线观| 成人污污视频在线观看| 国产成人精品1024| 大胆亚洲人体视频| 国产福利91精品一区二区三区| 国产成人综合亚洲91猫咪| 国产一区二区在线影院| 老鸭窝一区二区久久精品| 久久精品国产免费看久久精品| 蜜臀久久99精品久久久久宅男 | 欧美sm极限捆绑bd| 精品毛片乱码1区2区3区| 日韩免费电影网站| 精品日韩欧美一区二区| 久久你懂得1024| 国产区在线观看成人精品| 国产精品系列在线| 亚洲视频一区二区免费在线观看| 亚洲人成网站色在线观看| 亚洲蜜臀av乱码久久精品蜜桃| 一区二区三区久久久| 香蕉成人啪国产精品视频综合网| 日韩中文字幕麻豆|