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

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

?? os_mbox.c

?? uCos-ii 2.86 在C8051F410單片機上移植成功!!! 其中包括:UART驅動
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                       MESSAGE MAILBOX MANAGEMENT
*
*                              (c) Copyright 1992-2007, Micrium, Weston, FL
*                                           All Rights Reserved
*
* File    : OS_MBOX.C
* By      : Jean J. Labrosse
* Version : V2.86
*
* LICENSING TERMS:
* ---------------
*   uC/OS-II is provided in source form for FREE evaluation, for educational use or for peaceful research.  
* If you plan on using  uC/OS-II  in a commercial product you need to contact Micri祄 to properly license 
* its use in your product. We provide ALL the source code for your convenience and to help you experience 
* uC/OS-II.   The fact that the  source is provided does  NOT  mean that you can use it without  paying a 
* licensing fee.
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#include "..\header files\includes.h"
#endif

#if OS_MBOX_EN > 0
/*
*********************************************************************************************************
*                                     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 'pevent' is a NULL pointer or,
*                            if you didn't pass the proper event pointer.
*********************************************************************************************************
*/

#if OS_MBOX_ACCEPT_EN > 0
void  *OSMboxAccept (OS_EVENT *pevent) reentrant
{
    void      *pmsg;
#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 ((void *)0);
    }
#endif
    if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) {      /* Validate event block type                 */
        return ((void *)0);
    }
    OS_ENTER_CRITICAL();
    pmsg               = pevent->OSEventPtr;
    pevent->OSEventPtr = (void *)0;                       /* Clear the mailbox                         */
    OS_EXIT_CRITICAL();
    return (pmsg);                                        /* Return the message received (or NULL)     */
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                        CREATE A MESSAGE MAILBOX
*
* Description: This function creates a message mailbox if free event control blocks are available.
*
* Arguments  : pmsg          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    : != (OS_EVENT *)0  is a pointer to the event control clock (OS_EVENT) associated with the
*                                created mailbox
*              == (OS_EVENT *)0  if no event control blocks were available
*********************************************************************************************************
*/

OS_EVENT  *OSMboxCreate (void *pmsg) reentrant
{
    OS_EVENT  *pevent;
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr = 0;
#endif



    if (OSIntNesting > 0) {                      /* See if called from ISR ...                         */
        return ((OS_EVENT *)0);                  /* ... can't CREATE from an ISR                       */
    }
    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->OSEventCnt     = 0;
        pevent->OSEventPtr     = pmsg;           /* Deposit message in event control block             */
#if OS_EVENT_NAME_SIZE > 1
        pevent->OSEventName[0] = '?';
        pevent->OSEventName[1] = OS_ASCII_NUL;
#endif
        OS_EventWaitListInit(pevent);
    }
    return (pevent);                             /* Return pointer to event control block              */
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                         DELETE A MAIBOX
*
* Description: This function deletes a mailbox and readies all tasks pending on the mailbox.
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired
*                            mailbox.
*
*              opt           determines delete options as follows:
*                            opt == OS_DEL_NO_PEND   Delete the mailbox ONLY if no task pending
*                            opt == OS_DEL_ALWAYS    Deletes the mailbox even if tasks are waiting.
*                                                    In this case, all the tasks pending will be readied.
*
*              perr          is a pointer to an error code that can contain one of the following values:
*                            OS_ERR_NONE             The call was successful and the mailbox was deleted
*                            OS_ERR_DEL_ISR          If you attempted to delete the mailbox from an ISR
*                            OS_ERR_INVALID_OPT      An invalid option was specified
*                            OS_ERR_TASK_WAITING     One or more tasks were waiting on the mailbox
*                            OS_ERR_EVENT_TYPE       If you didn't pass a pointer to a mailbox
*                            OS_ERR_PEVENT_NULL      If 'pevent' is a NULL pointer.
*
* Returns    : pevent        upon error
*              (OS_EVENT *)0 if the mailbox was successfully deleted.
*
* Note(s)    : 1) This function must be used with care.  Tasks that would normally expect the presence of
*                 the mailbox MUST check the return code of OSMboxPend().
*              2) OSMboxAccept() callers will not know that the intended mailbox has been deleted!
*              3) This call can potentially disable interrupts for a long time.  The interrupt disable
*                 time is directly proportional to the number of tasks waiting on the mailbox.
*              4) Because ALL tasks pending on the mailbox will be readied, you MUST be careful in
*                 applications where the mailbox is used for mutual exclusion because the resource(s)
*                 will no longer be guarded by the mailbox.
*********************************************************************************************************
*/

#if OS_MBOX_DEL_EN > 0
OS_EVENT  *OSMboxDel (OS_EVENT *pevent, INT8U opt, INT8U *perr)	 reentrant
{
    BOOLEAN    tasks_waiting;
    OS_EVENT  *pevent_return;
#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 (perr == (INT8U *)0) {                              /* Validate 'perr'                          */
        return (pevent);
    }
    if (pevent == (OS_EVENT *)0) {                         /* Validate 'pevent'                        */
        *perr = OS_ERR_PEVENT_NULL;
        return (pevent);
    }
#endif
    if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) {       /* Validate event block type                */
        *perr = OS_ERR_EVENT_TYPE;
        return (pevent);
    }
    if (OSIntNesting > 0) {                                /* See if called from ISR ...               */
        *perr = OS_ERR_DEL_ISR;                            /* ... can't DELETE from an ISR             */
        return (pevent);
    }
    OS_ENTER_CRITICAL();
    if (pevent->OSEventGrp != 0) {                         /* See if any tasks waiting on mailbox      */
        tasks_waiting = OS_TRUE;                           /* Yes                                      */
    } else {
        tasks_waiting = OS_FALSE;                          /* No                                       */
    }
    switch (opt) {
        case OS_DEL_NO_PEND:                               /* Delete mailbox only if no task waiting   */
             if (tasks_waiting == OS_FALSE) {
#if OS_EVENT_NAME_SIZE > 1
                 pevent->OSEventName[0] = '?';             /* Unknown name                             */
                 pevent->OSEventName[1] = OS_ASCII_NUL;
#endif
                 pevent->OSEventType = OS_EVENT_TYPE_UNUSED;
                 pevent->OSEventPtr  = OSEventFreeList;    /* Return Event Control Block to free list  */
                 pevent->OSEventCnt  = 0;
                 OSEventFreeList     = pevent;             /* Get next free event control block        */
                 OS_EXIT_CRITICAL();
                 *perr               = OS_ERR_NONE;
                 pevent_return       = (OS_EVENT *)0;      /* Mailbox has been deleted                 */
             } else {
                 OS_EXIT_CRITICAL();
                 *perr               = OS_ERR_TASK_WAITING;
                 pevent_return       = pevent;
             }
             break;

        case OS_DEL_ALWAYS:                                /* Always delete the mailbox                */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美另类久久久精品| 欧美一区二区在线看| 伊人开心综合网| 精品久久久久久久久久久久久久久 | 久久99在线观看| 国产精品激情偷乱一区二区∴| 欧美精品久久久久久久多人混战| 波多野结衣亚洲一区| 青青国产91久久久久久| 亚洲视频在线一区| 久久精品一区二区三区不卡 | 欧美国产精品久久| 欧美一区二区三区免费视频| 91视频在线观看免费| 国内精品伊人久久久久av影院| 一区二区三区四区在线| 国产精品天干天干在观线| 欧美成人高清电影在线| 欧美日本一道本在线视频| 91在线视频观看| 成人免费看片app下载| 激情综合色播激情啊| 日本在线不卡视频| 亚洲1区2区3区4区| 一区二区三区四区国产精品| 最新高清无码专区| 国产精品全国免费观看高清 | 亚洲成人av资源| 亚洲精品久久嫩草网站秘色| 中文字幕的久久| ww久久中文字幕| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 亚洲综合在线五月| 亚洲欧美另类久久久精品 | 亚洲婷婷在线视频| 国产免费久久精品| 国产午夜精品久久久久久久| 欧美va亚洲va香蕉在线| 日韩欧美成人一区二区| 日韩三级视频在线观看| 欧美老肥妇做.爰bbww| 欧美猛男gaygay网站| 欧美色网站导航| 欧美精品乱人伦久久久久久| 欧美高清一级片在线| 91精品婷婷国产综合久久性色 | 日韩精品视频网站| 日韩黄色一级片| 蜜桃视频在线一区| 国内久久婷婷综合| 成人小视频在线| 不卡的av网站| 91一区二区三区在线观看| 91老司机福利 在线| 欧美在线综合视频| 91精品国产综合久久国产大片| 在线不卡中文字幕播放| 日韩欧美国产午夜精品| 久久久噜噜噜久噜久久综合| 国产精品乱码一区二区三区软件 | 美女爽到高潮91| 国精产品一区一区三区mba桃花 | 色网站国产精品| 欧美日韩一本到| 精品美女被调教视频大全网站| 久久天堂av综合合色蜜桃网| 日本一区二区三区免费乱视频| 自拍视频在线观看一区二区| 亚洲第一主播视频| 国内成人自拍视频| 99精品久久免费看蜜臀剧情介绍| 欧美最猛黑人xxxxx猛交| 欧美一区二区三区视频免费| 欧美精品一区二区三区蜜臀| 国产精品久久久久毛片软件| 亚洲国产aⅴ天堂久久| 精品在线一区二区| 91在线精品一区二区三区| 欧美日韩精品电影| 国产亚洲短视频| 一二三四区精品视频| 理论片日本一区| 成人动漫精品一区二区| 777亚洲妇女| 国产精品你懂的在线| 亚洲第一在线综合网站| 国产成人福利片| 欧美剧情片在线观看| 中文字幕免费不卡| 日韩黄色免费网站| 99精品国产视频| 日韩美女视频在线| 亚洲精品日韩综合观看成人91| 老司机午夜精品| 欧美三区在线观看| 中文字幕精品—区二区四季| 日本亚洲天堂网| 一本色道亚洲精品aⅴ| 精品国产凹凸成av人网站| 亚洲欧美日韩国产一区二区三区| 另类欧美日韩国产在线| 欧美色区777第一页| 国产精品沙发午睡系列990531| 久久精品久久久精品美女| 在线亚洲一区二区| 日本一区二区三区免费乱视频| 日本最新不卡在线| 欧美亚洲免费在线一区| 国产精品免费看片| 精品写真视频在线观看| 欧美三级中文字幕在线观看| 国产精品久久久久影视| 国产精品一区二区三区99| 日韩片之四级片| 亚洲成人先锋电影| 在线一区二区视频| 亚洲人xxxx| 波多野结衣欧美| 国产精品欧美综合在线| 国产精品一区一区三区| 精品国产一区二区三区不卡| 天堂av在线一区| 欧美精品三级日韩久久| 亚洲综合一二区| 在线视频一区二区免费| 亚洲另类春色国产| 色综合天天综合网国产成人综合天 | 日本美女一区二区三区| 欧美午夜不卡在线观看免费| 亚洲丝袜精品丝袜在线| av在线播放不卡| 久久精品无码一区二区三区| 精品一区二区三区欧美| 日韩精品一区二区三区中文不卡 | 国模一区二区三区白浆| 欧美刺激午夜性久久久久久久| 午夜电影一区二区| 欧美日韩免费视频| 亚洲成a人v欧美综合天堂下载| 色婷婷国产精品综合在线观看| 最新热久久免费视频| 92精品国产成人观看免费| 中文字幕在线不卡一区| 97精品视频在线观看自产线路二| 国产精品动漫网站| 91在线国内视频| 一区二区三区色| 欧美日韩中文字幕一区二区| 日产精品久久久久久久性色| 日韩一级片在线播放| 美国欧美日韩国产在线播放| wwwwxxxxx欧美| 成人精品视频.| 亚洲亚洲人成综合网络| 91.xcao| 国产在线不卡一区| 国产精品久久影院| 欧美吻胸吃奶大尺度电影| 日本一不卡视频| 国产午夜亚洲精品午夜鲁丝片| 成人国产在线观看| 一区二区欧美视频| 69av一区二区三区| 国产精品自在在线| 亚洲欧洲日产国产综合网| 欧美日韩情趣电影| 久久99精品国产| 中文字幕一区av| 欧美日韩亚洲丝袜制服| 激情都市一区二区| 成人免费在线视频| 欧美情侣在线播放| 国产成人精品亚洲午夜麻豆| 亚洲乱码精品一二三四区日韩在线| 欧美视频一区二区三区四区 | 久久电影网电视剧免费观看| 国产欧美日韩视频在线观看| 欧洲精品一区二区三区在线观看| 日本sm残虐另类| 一区在线观看免费| 欧美乱熟臀69xxxxxx| 韩日av一区二区| 亚洲一区在线观看免费| 精品久久久久久无| 欧美在线观看一二区| 国产资源在线一区| 亚洲国产成人91porn| 国产午夜精品在线观看| 欧美日韩黄视频| 成人黄色av电影| 久久狠狠亚洲综合| 国产精品传媒视频| 欧美成人欧美edvon| 一本色道久久综合精品竹菊 | 欧美日韩一区视频| 成人午夜免费av| 麻豆成人91精品二区三区| 一级中文字幕一区二区| 欧美激情中文字幕| 日韩欧美中文字幕公布|