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

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

?? os_mbox.c

?? 移植好的UCOS2.86版
?? 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 <ucos_ii.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)
{
    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)
{
    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)
{
    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一区二区三区免费野_久草精品视频
日韩你懂的在线播放| 欧美人与禽zozo性伦| 久久99国产精品久久| 日韩国产成人精品| 日韩在线播放一区二区| 国产在线一区二区| 蜜桃视频一区二区三区在线观看| 久久国内精品视频| 亚洲三级在线播放| 亚洲欧美在线aaa| 亚洲人成在线观看一区二区| 亚洲欧美日韩一区二区三区在线观看| 亚洲欧洲综合另类在线| 激情综合网天天干| 免费观看日韩电影| 亚洲午夜国产一区99re久久| 日韩av电影免费观看高清完整版在线观看| 亚洲男人的天堂一区二区| 亚洲免费三区一区二区| 美女一区二区三区在线观看| 九九视频精品免费| 91蜜桃在线免费视频| 欧美日韩你懂得| 久久亚洲一级片| 亚洲一区二区三区四区在线| 日韩和欧美一区二区| 麻豆一区二区三区| 欧美午夜电影在线播放| 国产精品网站在线观看| 日本美女视频一区二区| 91女人视频在线观看| 欧美成人vps| 国产精品电影一区二区| 国产成人高清在线| 日韩欧美一级二级| 17c精品麻豆一区二区免费| 91理论电影在线观看| 2022国产精品视频| 成人免费毛片嘿嘿连载视频| 亚洲成人一区二区| 亚洲精品一线二线三线无人区| 欧美午夜精品免费| 国产成人在线视频免费播放| 色猫猫国产区一区二在线视频| 成人在线视频一区| 2023国产精华国产精品| 美女一区二区久久| 国产精品初高中害羞小美女文| 亚洲欧洲在线观看av| 亚洲高清不卡在线| 奇米777欧美一区二区| www.亚洲精品| 精品盗摄一区二区三区| 亚洲成人你懂的| 成人毛片在线观看| www久久久久| 久久精品国内一区二区三区| 一本大道久久a久久精二百| 久久蜜桃香蕉精品一区二区三区| 亚洲动漫第一页| 91极品视觉盛宴| 国产精品久久午夜| 国产一区二区中文字幕| 日韩女优毛片在线| 丝瓜av网站精品一区二区 | 国产精品福利影院| 国产精品自拍三区| 久久久精品黄色| 国产精品原创巨作av| 欧美一级二级三级蜜桃| 婷婷激情综合网| 欧美一区永久视频免费观看| 三级欧美在线一区| 欧美人牲a欧美精品| 一个色在线综合| 欧美性猛片xxxx免费看久爱 | 欧美日本在线一区| 亚洲一区二区三区美女| 欧美性xxxxx极品少妇| 一区二区三区四区不卡视频| 97超碰欧美中文字幕| 亚洲四区在线观看| 日本福利一区二区| 亚洲午夜精品17c| 欧美精选一区二区| 美女久久久精品| 国产欧美精品一区二区色综合| 韩国午夜理伦三级不卡影院| 久久亚洲私人国产精品va媚药| 精油按摩中文字幕久久| 久久久蜜臀国产一区二区| 国产老妇另类xxxxx| 国产精品丝袜一区| 日本韩国一区二区三区视频| 亚洲r级在线视频| 日韩写真欧美这视频| 韩国理伦片一区二区三区在线播放| 精品国产凹凸成av人导航| 国产69精品久久99不卡| 亚洲三级电影网站| 欧美日韩www| 国产精品一区不卡| 亚洲宅男天堂在线观看无病毒| 日韩亚洲国产中文字幕欧美| 大陆成人av片| 午夜欧美大尺度福利影院在线看| 日韩一级片在线观看| 高潮精品一区videoshd| 亚洲一区在线看| 久久亚洲一区二区三区四区| 日本韩国一区二区三区| 国产一区激情在线| 亚洲午夜激情网页| 国产目拍亚洲精品99久久精品| 欧美在线三级电影| 国产精品自拍网站| 丝袜脚交一区二区| 自拍偷拍国产精品| 欧美v亚洲v综合ⅴ国产v| 91浏览器打开| 国产乱码精品一区二区三区av| 亚洲图片欧美综合| 国产精品网站在线播放| 欧美一区二区三区不卡| av一二三不卡影片| 国内外成人在线| 日韩av成人高清| 亚洲精品一卡二卡| 国产精品视频看| 久久网站热最新地址| 欧美高清视频www夜色资源网| 粉嫩嫩av羞羞动漫久久久 | 亚洲精品一区二区三区精华液| 91精品福利在线| eeuss国产一区二区三区| 青青草原综合久久大伊人精品优势| 国产精品乱码妇女bbbb| 久久夜色精品国产噜噜av| 欧美三级资源在线| 色婷婷国产精品久久包臀 | 欧美精品99久久久**| 91激情在线视频| 色吊一区二区三区| 色婷婷av一区二区三区大白胸| 成人app下载| av一区二区三区| 色先锋aa成人| 91免费观看国产| 91麻豆.com| 欧美日韩在线三级| 欧美日韩一二三| 91精品国产高清一区二区三区蜜臀| 欧美丝袜丝nylons| 欧美在线视频你懂得| 精品视频全国免费看| 欧美日韩高清一区二区三区| 欧美日韩免费高清一区色橹橹| 欧美日精品一区视频| 91.com视频| 欧美va日韩va| 国产三级精品三级| 日韩一区在线播放| 午夜久久福利影院| 久久成人综合网| 福利一区福利二区| 色哟哟亚洲精品| 这里是久久伊人| 久久综合久久综合久久综合| 国产校园另类小说区| 亚洲私人影院在线观看| 天天综合网天天综合色| 蜜乳av一区二区| 国产999精品久久久久久 | 亚洲 欧美综合在线网络| 日韩国产一区二| 国产精品18久久久久久久久| 成人av网在线| 欧美丰满少妇xxxxx高潮对白| 日韩亚洲欧美一区二区三区| 久久综合色鬼综合色| 亚洲欧美另类在线| 日本不卡一二三区黄网| 国产一区二区美女| 91麻豆自制传媒国产之光| 日韩天堂在线观看| 中文字幕一区在线| 男人的j进女人的j一区| 97精品久久久久中文字幕| 欧美一区二区三区四区高清| 中文字幕 久热精品 视频在线 | 国产日韩精品一区二区浪潮av| 玉足女爽爽91| 国产一区二区三区四区在线观看| 91视频观看免费| 久久综合九色欧美综合狠狠| 亚洲无线码一区二区三区| 成人精品免费网站| 日韩一区二区三区高清免费看看| 成人欧美一区二区三区1314| 久久精品国内一区二区三区|