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

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

?? os_mbox.c

?? 瑞泰創(chuàng)新的GX-ARM9-2410EP教學(xué)實(shí)驗(yàn)系統(tǒng)的所有基礎(chǔ)實(shí)驗(yàn)源代碼,內(nèi)容齊全,解析清楚,基本上每個(gè)實(shí)驗(yàn)結(jié)果都有圖片顯示
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*
*********************************************************************************************************
*                                                uC/OS-II
*                                          The Real-Time Kernel
*                                       MESSAGE MAILBOX MANAGEMENT
*
*                          (c) Copyright 1992-2002, Jean J. Labrosse, Weston, FL
*                                           All Rights Reserved
*
* File : OS_MBOX.C
* By   : Jean J. Labrosse
*********************************************************************************************************
*/

#ifndef  OS_MASTER_FILE
#include "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)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    void      *msg;


#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();
    msg                = pevent->OSEventPtr;
    pevent->OSEventPtr = (void *)0;                       /* Clear the mailbox                         */
    OS_EXIT_CRITICAL();
    return (msg);                                         /* 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  : 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    : != (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 *msg)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    
    OS_EVENT  *pevent;


    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  = msg;               /* Deposit message in event control block             */
#if OS_EVENT_NAME_SIZE > 0
        (void)strcpy(pevent->OSEventName, "?");
#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.
*
*              err           is a pointer to an error code that can contain one of the following values:
*                            OS_NO_ERR               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 *err)
{
#if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register */
    OS_CPU_SR  cpu_sr;
#endif    
    BOOLEAN    tasks_waiting;


    if (OSIntNesting > 0) {                                /* See if called from ISR ...               */
        *err = OS_ERR_DEL_ISR;                             /* ... can't DELETE from an ISR             */
        return (pevent);
    }
#if OS_ARG_CHK_EN > 0
    if (pevent == (OS_EVENT *)0) {                         /* Validate 'pevent'                        */
        *err = OS_ERR_PEVENT_NULL;
        return (pevent);
    }
#endif
    if (pevent->OSEventType != OS_EVENT_TYPE_MBOX) {       /* Validate event block type                */
        *err = OS_ERR_EVENT_TYPE;
        return (pevent);
    }
    OS_ENTER_CRITICAL();
    if (pevent->OSEventGrp != 0x00) {                      /* See if any tasks waiting on mailbox      */
        tasks_waiting = TRUE;                              /* Yes                                      */
    } else {
        tasks_waiting = FALSE;                             /* No                                       */
    }
    switch (opt) {
        case OS_DEL_NO_PEND:                               /* Delete mailbox only if no task waiting   */
             if (tasks_waiting == FALSE) {
#if OS_EVENT_NAME_SIZE > 0
                 (void)strcpy(pevent->OSEventName, "?");   /* Unknown name                             */
#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();
                 *err                = OS_NO_ERR;
                 return ((OS_EVENT *)0);                   /* Mailbox has been deleted                 */
             } else {
                 OS_EXIT_CRITICAL();
                 *err                = OS_ERR_TASK_WAITING;
                 return (pevent);
             }

        case OS_DEL_ALWAYS:                                /* Always delete the mailbox                */
             while (pevent->OSEventGrp != 0x00) {          /* Ready ALL tasks waiting for mailbox      */
                 OS_EventTaskRdy(pevent, (void *)0, OS_STAT_MBOX);
             }
#if OS_EVENT_NAME_SIZE > 0
             (void)strcpy(pevent->OSEventName, "?");       /* Unknown name                             */
#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();
             if (tasks_waiting == TRUE) {                  /* Reschedule only if task(s) were waiting  */
                 OS_Sched();                               /* Find highest priority task ready to run  */
             }
             *err = OS_NO_ERR;
             return ((OS_EVENT *)0);                       /* Mailbox has been deleted                 */

        default:
             OS_EXIT_CRITICAL();
             *err = OS_ERR_INVALID_OPT;
             return (pevent);
    }
}
#endif

/*$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.
*                            OS_ERR_PEVENT_NULL  If 'pevent' is a NULL pointer
*
* Returns    : != (void *)0  is a pointer to the message received
*              == (void *)0  if no message was received or,
*                            if 'pevent' is a NULL pointer or,
*                            if you didn't pass the proper pointer to the event control block.
*********************************************************************************************************
*/

void  *OSMboxPend (OS_EVENT *pevent, INT16U timeout, INT8U *err)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif    

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精华液一区二区三区| 国产一区二区三区四区五区入口| 91在线观看免费视频| 国产午夜精品久久久久久久| 激情综合网av| 久久综合色8888| 激情五月播播久久久精品| 日韩欧美色综合网站| 蜜桃视频免费观看一区| 91精品国产91热久久久做人人| 性感美女久久精品| 91精品国产综合久久福利软件| 亚洲 欧美综合在线网络| 欧美高清dvd| 日本不卡的三区四区五区| 日韩限制级电影在线观看| 免费av成人在线| 欧美电影免费观看完整版| 精品亚洲成av人在线观看| 久久蜜桃一区二区| 床上的激情91.| 中文字幕一区二区三区不卡在线| 不卡高清视频专区| 亚洲精品乱码久久久久| 在线看日本不卡| 视频一区视频二区中文| 欧美大片免费久久精品三p| 韩国三级电影一区二区| 久久精品一区八戒影视| jvid福利写真一区二区三区| 亚洲人精品一区| 欧美日韩另类国产亚洲欧美一级| 视频一区二区三区中文字幕| 日韩一区二区不卡| 国产成人午夜视频| 国产精品天美传媒| 欧美性淫爽ww久久久久无| 石原莉奈在线亚洲二区| 精品国产凹凸成av人导航| 粉嫩aⅴ一区二区三区四区五区| 1024精品合集| 欧美色综合天天久久综合精品| 日韩精品电影在线| 国产日韩欧美一区二区三区综合| 99久久综合国产精品| 亚洲综合成人在线| 欧美电影免费观看高清完整版在线 | 91偷拍与自偷拍精品| 樱桃国产成人精品视频| 91麻豆精品国产91久久久使用方法 | 国产98色在线|日韩| 亚洲激情五月婷婷| 欧美大片顶级少妇| 91一区二区在线| 男女男精品视频网| 欧美国产激情一区二区三区蜜月| 色综合激情久久| 奇米一区二区三区av| 国产精品美女视频| 777午夜精品免费视频| 国产成人无遮挡在线视频| 亚洲已满18点击进入久久| 久久综合网色—综合色88| 一本大道av一区二区在线播放| 日韩av在线发布| 国产精品成人一区二区艾草| 欧美精品一卡二卡| 成人av一区二区三区| 丝袜美腿亚洲综合| 亚洲欧洲日韩综合一区二区| 日韩一区二区三| 色综合天天狠狠| 国产一区美女在线| 亚洲一二三四久久| 欧美国产日韩亚洲一区| 欧美女孩性生活视频| 成人夜色视频网站在线观看| 视频一区在线播放| 亚洲精品欧美综合四区| 久久综合色之久久综合| 欧美日韩激情一区二区三区| av电影在线观看完整版一区二区| 蜜桃av一区二区| 亚洲自拍偷拍九九九| 国产视频一区二区在线| 91精品欧美综合在线观看最新| 波多野洁衣一区| 韩国av一区二区三区| 天天综合色天天| 一区二区三区日韩欧美| 国产欧美日韩视频一区二区| 6080午夜不卡| 91九色最新地址| 成人精品视频一区二区三区尤物| 美女视频免费一区| 无码av免费一区二区三区试看 | 99国产精品久久久久久久久久| 免费成人在线视频观看| 亚洲成人免费电影| 亚洲乱码国产乱码精品精98午夜| 久久精品人人爽人人爽| 精品久久国产老人久久综合| 制服丝袜日韩国产| 欧美体内she精视频| 91在线你懂得| 成人va在线观看| 国产精品1024| 国内精品久久久久影院色| 久热成人在线视频| 石原莉奈在线亚洲二区| 亚洲国产乱码最新视频| 亚洲欧美色一区| 亚洲日本中文字幕区| 国产精品不卡在线| 日本一区二区免费在线| 久久亚洲二区三区| 精品国产青草久久久久福利| 日韩免费看的电影| 日韩精品一区国产麻豆| 日韩一区二区三区在线视频| 91精品国产综合久久久久| 欧美人妇做爰xxxⅹ性高电影| 日本精品一区二区三区四区的功能| 成人黄色a**站在线观看| 成人国产在线观看| av中文字幕在线不卡| 成人av午夜影院| 91视频免费观看| 91麻豆6部合集magnet| 色综合久久久网| 色狠狠一区二区| 在线这里只有精品| 欧美视频在线一区二区三区| 欧美综合在线视频| 欧美日韩在线三区| 欧美老女人在线| 欧美一区二区三区日韩| 欧美成人三级在线| 精品国产一区久久| 国产日韩欧美a| 国产欧美一区二区三区鸳鸯浴| 中文字幕av资源一区| ●精品国产综合乱码久久久久| 一区在线观看免费| 亚洲图片一区二区| 免费精品99久久国产综合精品| 久久精品99久久久| 国产suv精品一区二区883| 9人人澡人人爽人人精品| 日本韩国欧美国产| 91精品一区二区三区久久久久久| 日韩三级精品电影久久久| 精品久久久久久亚洲综合网| 国产丝袜在线精品| 亚洲精品国产一区二区精华液| 亚洲bt欧美bt精品| 美女性感视频久久| 丁香婷婷综合五月| 日本精品免费观看高清观看| 欧美精品18+| 国产色产综合色产在线视频| 国产精品久久毛片a| 亚洲综合男人的天堂| 日本免费新一区视频| 国产乱码字幕精品高清av| 99精品欧美一区二区三区小说| 欧美色倩网站大全免费| 精品国产一区二区三区久久久蜜月 | 91精品国产aⅴ一区二区| 精品久久久久久久久久久久久久久 | 亚洲色欲色欲www在线观看| 亚洲夂夂婷婷色拍ww47| 久久av中文字幕片| 成人成人成人在线视频| 精品污污网站免费看| 2022国产精品视频| 亚洲精品国产一区二区精华液| 日本成人在线一区| 懂色av一区二区三区免费看| 欧美亚洲国产一区在线观看网站| 日韩一区二区三区视频| 国产精品久久看| 石原莉奈一区二区三区在线观看| 国产精品一区二区久久不卡 | 欧美在线|欧美| 欧美v国产在线一区二区三区| 国产精品成人免费| 青青青伊人色综合久久| av中文字幕在线不卡| 欧美一区二区三区电影| 国产精品久久毛片| 免费成人美女在线观看.| 99综合电影在线视频| 欧美一三区三区四区免费在线看 | 亚洲1区2区3区视频| 国产成人午夜视频| 91麻豆精品国产91久久久| 中文字幕乱码亚洲精品一区| 三级一区在线视频先锋| av电影在线不卡|