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

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

?? os_mbox.c

?? uC/OS-II在C51下的一個(gè)完整的LCD項(xiàng)目源碼。
?? C
字號(hào):
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                       MESSAGE MAILBOX MANAGEMENT
*
*                        (c) Copyright 1992-1998, Jean J. Labrosse, Plantation, FL
*                                           All Rights Reserved
*
*                                                  V2.00
*
* File : OS_MBOX.C
* By   : Jean J. Labrosse
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#include "includes.h"
#endif

#if OS_MBOX_EN
/*
*********************************************************************************************************
*                                     ACCEPT MESSAGE FROM MAILBOX
*
* Description: This function checks the mailbox to see if a message is available.  Unlike OSMboxPend(),
*              OSMboxAccept() does not suspend the calling task if a message is not available.
*
* Arguments  : pevent        is a pointer to the event control block
*
* Returns    : != (void *)0  is the message in the mailbox if one is available.  The mailbox is cleared
*                            so the next time OSMboxAccept() is called, the mailbox will be empty.
*              == (void *)0  if the mailbox is empty or if you didn't pass the proper event pointer.
*********************************************************************************************************
*/

void *OSMboxAccept (OS_EVENT *pevent) reentrant
{
    void  *msg;


    OS_ENTER_CRITICAL();
    if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) {      /* Validate event block type                 */
        OS_EXIT_CRITICAL();
        return ((void *)0);
    }
    msg = pevent->OSEventPtr; 
    if (msg != (void *)0) {                               /* See if there is already a message         */
        pevent->OSEventPtr = (void *)0;                   /* Clear the mailbox                         */
    }
    OS_EXIT_CRITICAL();
    return (msg);                                         /* Return the message received (or NULL)     */
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                        CREATE A MESSAGE MAILBOX
*
* Description: This function creates a message mailbox if free event control blocks are available.
*
* Arguments  : msg           is a pointer to a message that you wish to deposit in the mailbox.  If
*                            you set this value to the NULL pointer (i.e. (void *)0) then the mailbox
*                            will be considered empty.
*
* Returns    : != (void *)0  is a pointer to the event control clock (OS_EVENT) associated with the
*                            created mailbox
*              == (void *)0  if no event control blocks were available
*********************************************************************************************************
*/

OS_EVENT *OSMboxCreate (void *msg) reentrant
{
    OS_EVENT *pevent;


    OS_ENTER_CRITICAL();
    pevent = OSEventFreeList;                    /* Get next free event control block                  */
    if (OSEventFreeList != (OS_EVENT *)0) {      /* See if pool of free ECB pool was empty             */
        OSEventFreeList = (OS_EVENT *)OSEventFreeList->OSEventPtr;
    }
    OS_EXIT_CRITICAL();
    if (pevent != (OS_EVENT *)0) {
        pevent->OSEventType = OS_EVENT_TYPE_MBOX;
        pevent->OSEventPtr  = msg;               /* Deposit message in event control block             */
        OSEventWaitListInit(pevent);
    }
    return (pevent);                             /* Return pointer to event control block              */
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                      PEND ON MAILBOX FOR A MESSAGE
*
* Description: This function waits for a message to be sent to a mailbox
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired mailbox
*
*              timeout       is an optional timeout period (in clock ticks).  If non-zero, your task will
*                            wait for a message to arrive at the mailbox up to the amount of time 
*                            specified by this argument.  If you specify 0, however, your task will wait 
*                            forever at the specified mailbox 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 Invalid event type
*                            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 the proper pointer to the
*                            event control block.
*********************************************************************************************************
*/

void *OSMboxPend (OS_EVENT *pevent, INT16U timeout, INT8U *err) reentrant
{
    void  *msg;


    OS_ENTER_CRITICAL();
    if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) {  /* Validate event block type                     */
        OS_EXIT_CRITICAL();
        *err = OS_ERR_EVENT_TYPE;
        return ((void *)0);
    }
    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;
    } 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_MBOX;          /* Message not available, task will pend         */
        OSTCBCur->OSTCBDly   = timeout;               /* Load timeout in 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) {     /* 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;
        } else if (OSTCBCur->OSTCBStat & OS_STAT_MBOX) {   /* If status is not OS_STAT_RDY, timed out  */
            OSEventTO(pevent);                             /* Make task ready                          */
            OS_EXIT_CRITICAL();
            msg                     = (void *)0;           /* Set message contents to NULL             */
            *err                    = OS_TIMEOUT;          /* Indicate that a timeout occured          */
        } else {
            msg                     = pevent->OSEventPtr;  /* Message received                         */
            pevent->OSEventPtr      = (void *)0;           /* Clear the mailbox                        */
            OSTCBCur->OSTCBEventPtr = (OS_EVENT *)0;
            OS_EXIT_CRITICAL();
            *err                    = OS_NO_ERR;
        }
    }
    return (msg);                                          /* Return the message received (or NULL)    */
}
/*$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.
*********************************************************************************************************
*/

INT8U OSMboxPost (OS_EVENT *pevent, void *msg) reentrant
{
    OS_ENTER_CRITICAL();
    if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) {  /* Validate event block type                     */
        OS_EXIT_CRITICAL();
        return (OS_ERR_EVENT_TYPE);
    }
    if (pevent->OSEventGrp) {                         /* See if any task pending on mailbox            */
        OSEventTaskRdy(pevent, msg, OS_STAT_MBOX);    /* Ready highest priority task waiting on event  */
        OS_EXIT_CRITICAL();
        OSSched();                                    /* Find highest priority task ready to run       */
        return (OS_NO_ERR);
    } else {
        if (pevent->OSEventPtr != (void *)0) {        /* Make sure mailbox doesn't already have a msg  */
            OS_EXIT_CRITICAL();
            return (OS_MBOX_FULL);
        } else {
            pevent->OSEventPtr = msg;                 /* Place message in mailbox                      */
            OS_EXIT_CRITICAL();
            return (OS_NO_ERR);
        }
    }
}
/*$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.
*********************************************************************************************************
*/

INT8U OSMboxQuery (OS_EVENT *pevent, OS_MBOX_DATA *ppdata) reentrant
{
    INT8U  i;
    INT8U *psrc;
    INT8U *pdest;
    
    
    OS_ENTER_CRITICAL();
    if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) {       /* 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++;   
    }
    ppdata->OSMsg = pevent->OSEventPtr;                     /* Get message from mailbox                 */
    OS_EXIT_CRITICAL();
    return (OS_NO_ERR);
}
#endif

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费不卡在线视频| 欧美激情综合在线| 欧美在线观看视频一区二区| 国产精品一二三区| 久久国产视频网| 免费的成人av| 久久电影网电视剧免费观看| 国产乱码精品一区二区三区五月婷 | 久久66热偷产精品| 蜜桃视频在线一区| 狠狠色丁香婷婷综合| 国产在线麻豆精品观看| 国产综合色在线| 极品少妇xxxx精品少妇| 国产精品白丝av| 99麻豆久久久国产精品免费 | 亚洲高清视频在线| 日韩中文字幕av电影| 免费成人美女在线观看| 天天综合天天做天天综合| 日本成人中文字幕在线视频| 亚洲二区视频在线| 国产丝袜欧美中文另类| av网站免费线看精品| 91网站在线播放| 欧美性高清videossexo| 欧美成人video| 中文字幕精品—区二区四季| 一区二区三区日韩欧美精品| 日韩va欧美va亚洲va久久| 国产美女主播视频一区| 色综合久久久久网| 欧美精品高清视频| 国产蜜臀97一区二区三区 | 国产露脸91国语对白| aa级大片欧美| 欧美综合天天夜夜久久| 2014亚洲片线观看视频免费| 亚洲精品写真福利| 国产乱妇无码大片在线观看| 欧洲视频一区二区| 中文久久乱码一区二区| 亚洲va韩国va欧美va| 岛国精品在线播放| 欧美一级欧美一级在线播放| 日韩毛片在线免费观看| 国产在线观看一区二区| 欧美日韩一本到| 国产精品你懂的在线| 久久国产尿小便嘘嘘| 欧美日韩1区2区| 国产精品久久久久久久久免费樱桃| 三级在线观看一区二区| 色久优优欧美色久优优| 国产喷白浆一区二区三区| 美女久久久精品| 欧美日韩三级一区| 亚洲欧美激情小说另类| 处破女av一区二区| 久久无码av三级| 久久电影网电视剧免费观看| 337p亚洲精品色噜噜噜| 亚洲大尺度视频在线观看| 色综合天天综合色综合av| 国产日韩精品一区| 激情成人午夜视频| 日韩精品一区二区三区中文不卡 | 2023国产精品自拍| 五月天一区二区| 91福利在线播放| 亚洲欧美日韩在线| 9人人澡人人爽人人精品| 国产欧美综合色| 高清不卡在线观看av| 久久久蜜桃精品| 国产精品中文字幕一区二区三区| 欧美一区二区三区视频免费播放 | 久久久久久久久久久久电影| 男女视频一区二区| 日韩一区二区三区视频| 精品一区二区三区免费视频| 日韩欧美www| 久久成人免费网站| 国产婷婷一区二区| 国产不卡视频一区| 日本一区二区电影| 91婷婷韩国欧美一区二区| 最新国产の精品合集bt伙计| av不卡免费电影| 亚洲一二三区在线观看| 欧美日本在线看| 久热成人在线视频| 日本一区二区动态图| 99精品热视频| 一区二区三区四区国产精品| 欧美日韩久久久| 麻豆一区二区在线| 中文幕一区二区三区久久蜜桃| 91麻豆蜜桃一区二区三区| 亚洲成人中文在线| 久久久久久久久久久99999| 99九九99九九九视频精品| 亚洲一级在线观看| 久久久五月婷婷| 欧美在线不卡视频| 欧美aaa在线| 精品免费一区二区三区| 国产一本一道久久香蕉| 亚洲精品菠萝久久久久久久| 欧美日韩色一区| 成人综合在线网站| 午夜电影网亚洲视频| 欧美激情一区二区三区蜜桃视频| 欧美性猛交一区二区三区精品| 国产在线精品一区二区夜色 | 91精品国产一区二区人妖| 国产一区二区在线观看视频| 一区二区三区在线看| 26uuu欧美| 欧美日韩亚洲高清一区二区| 粉嫩一区二区三区性色av| 五月综合激情婷婷六月色窝| 国产精品视频在线看| 日韩一区和二区| 国产剧情一区二区三区| 日韩欧美国产精品| 成人av网址在线| 日韩不卡一区二区三区| 国产精品国产三级国产三级人妇| 在线综合视频播放| 色综合天天做天天爱| 韩国成人在线视频| 玉米视频成人免费看| 国产欧美一区二区在线观看| 欧美一区二区在线播放| 91视频com| www.在线成人| 国产黄色成人av| 精品一区二区三区在线播放| 亚洲v日本v欧美v久久精品| 国产在线不卡一卡二卡三卡四卡| 免费观看91视频大全| 亚洲人吸女人奶水| 国产欧美日韩亚州综合| 91精品国产高清一区二区三区蜜臀 | 性做久久久久久| 亚洲欧洲国产日韩| 国产清纯白嫩初高生在线观看91 | 日韩精品专区在线影院观看| 色婷婷久久一区二区三区麻豆| 成人性视频网站| 国产精品1024| 国产福利一区二区三区视频| 九一九一国产精品| 精品一区二区三区欧美| 亚洲视频电影在线| 成人午夜电影网站| 久久国产乱子精品免费女| 丝袜亚洲另类欧美| 亚洲一区在线电影| 午夜精品福利视频网站| 无码av免费一区二区三区试看| 亚洲成av人片一区二区三区| 亚洲第一福利一区| 免费在线看成人av| 精品一区二区三区的国产在线播放| 久久av资源站| 丁香另类激情小说| 日本道免费精品一区二区三区| 欧美最猛性xxxxx直播| 欧美日韩国产电影| 精品99久久久久久| 国产偷国产偷精品高清尤物| 中文字幕在线不卡国产视频| 亚洲永久免费av| 日本在线观看不卡视频| 国产在线一区二区综合免费视频| 国产69精品久久99不卡| 色婷婷激情一区二区三区| 99精品在线观看视频| 欧美视频三区在线播放| 日韩欧美国产麻豆| 国产精品欧美一区喷水| 亚洲国产精品影院| 国产河南妇女毛片精品久久久| 99精品视频中文字幕| 4438x成人网最大色成网站| 久久久久国产一区二区三区四区| 亚洲免费观看高清在线观看| 青椒成人免费视频| 在线视频中文字幕一区二区| 日韩美女一区二区三区| 中文字幕制服丝袜一区二区三区 | 亚洲欧美电影院| 美国av一区二区| 一本一道久久a久久精品| 日韩一区二区在线观看视频| 综合中文字幕亚洲| 国产一区三区三区| 欧美三级午夜理伦三级中视频|