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

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

?? os_q.c

?? UCOS最新版本。VERSION 2.80。完整
?? C
?? 第 1 頁 / 共 3 頁
字號:
                 *err                   = OS_ERR_TASK_WAITING;
                 pevent_return          = pevent;
             }
             break;

        case OS_DEL_ALWAYS:                                /* Always delete the queue                  */
             while (pevent->OSEventGrp != 0) {             /* Ready ALL tasks waiting for queue        */
                 (void)OS_EventTaskRdy(pevent, (void *)0, OS_STAT_Q);
             }
#if OS_EVENT_NAME_SIZE > 1
             pevent->OSEventName[0] = '?';                 /* Unknown name                             */
             pevent->OSEventName[1] = OS_ASCII_NUL;
#endif
             pq                     = (OS_Q *)pevent->OSEventPtr;   /* Return OS_Q to free list        */
             pq->OSQPtr             = OSQFreeList;
             OSQFreeList            = pq;
             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;
             pevent_return          = (OS_EVENT *)0;       /* Queue has been deleted                   */
             break;

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

/*$PAGE*/
/*
*********************************************************************************************************
*                                             FLUSH QUEUE
*
* Description : This function is used to flush the contents of the message queue.
*
* Arguments   : none
*
* Returns     : OS_NO_ERR           upon success
*               OS_ERR_EVENT_TYPE   If you didn't pass a pointer to a queue
*               OS_ERR_PEVENT_NULL  If 'pevent' is a NULL pointer
*
* WARNING     : You should use this function with great care because, when to flush the queue, you LOOSE
*               the references to what the queue entries are pointing to and thus, you could cause
*               'memory leaks'.  In other words, the data you are pointing to that's being referenced
*               by the queue entries should, most likely, need to be de-allocated (i.e. freed).
*********************************************************************************************************
*/

#if OS_Q_FLUSH_EN > 0
INT8U  OSQFlush (OS_EVENT *pevent)
{
    OS_Q      *pq;
#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 (OS_ERR_PEVENT_NULL);
    }
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {     /* Validate event block type                     */
        return (OS_ERR_EVENT_TYPE);
    }
#endif
    OS_ENTER_CRITICAL();
    pq             = (OS_Q *)pevent->OSEventPtr;      /* Point to queue storage structure              */
    pq->OSQIn      = pq->OSQStart;
    pq->OSQOut     = pq->OSQStart;
    pq->OSQEntries = 0;
    OS_EXIT_CRITICAL();
    return (OS_NO_ERR);
}
#endif

/*$PAGE*/
/*
*********************************************************************************************************
*                                     PEND ON A QUEUE FOR A MESSAGE
*
* Description: This function waits for a message to be sent to a queue
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired queue
*
*              timeout       is an optional timeout period (in clock ticks).  If non-zero, your task will
*                            wait for a message to arrive at the queue up to the amount of time
*                            specified by this argument.  If you specify 0, however, your task will wait
*                            forever at the specified queue 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   You didn't pass a pointer to a queue
*                            OS_ERR_PEVENT_NULL  If 'pevent' is a NULL pointer
*                            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 you received a NULL pointer message or,
*                            if no message was received or,
*                            if 'pevent' is a NULL pointer or,
*                            if you didn't pass a pointer to a queue.
*
* Note(s)    : As of V2.60, this function allows you to receive NULL pointer messages.
*********************************************************************************************************
*/

void  *OSQPend (OS_EVENT *pevent, INT16U timeout, INT8U *err)
{
    void      *msg;
    OS_Q      *pq;
#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 (err == (INT8U *)0) {                     /* Validate 'err'                                     */
        return ((void *)0);
    }
    if (pevent == (OS_EVENT *)0) {               /* Validate 'pevent'                                  */
        *err = OS_ERR_PEVENT_NULL;
        return ((void *)0);
    }
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {/* Validate event block type                          */
        *err = OS_ERR_EVENT_TYPE;
        return ((void *)0);
    }
#endif
    if (OSIntNesting > 0) {                      /* See if called from ISR ...                         */
        *err = OS_ERR_PEND_ISR;                  /* ... can't PEND from an ISR                         */
        return ((void *)0);
    }
    OS_ENTER_CRITICAL();
    pq = (OS_Q *)pevent->OSEventPtr;             /* Point at queue control block                       */
    if (pq->OSQEntries > 0) {                    /* See if any messages in the queue                   */
        msg = *pq->OSQOut++;                     /* Yes, extract oldest message from the queue         */
        pq->OSQEntries--;                        /* Update the number of entries in the queue          */
        if (pq->OSQOut == pq->OSQEnd) {          /* Wrap OUT pointer if we are at the end of the queue */
            pq->OSQOut = pq->OSQStart;
        }
        OS_EXIT_CRITICAL();
        *err = OS_NO_ERR;
        return (msg);                            /* Return message received                            */
    }
    OSTCBCur->OSTCBStat   |= OS_STAT_Q;          /* Task will have to pend for a message to be posted  */
    OSTCBCur->OSTCBPendTO  = FALSE;
    OSTCBCur->OSTCBDly     = timeout;            /* Load timeout into 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();
    if (OSTCBCur->OSTCBPendTO == TRUE) {         /* Was task readied because of a timeout?             */
        OS_EventTO(pevent);                      /* Yes                                                */
        OS_EXIT_CRITICAL();
        *err = OS_TIMEOUT;                       /*     Indicate a timeout occured                     */
        return ((void *)0);                      /*     No message received                            */
    }
    msg                     = OSTCBCur->OSTCBMsg;/* No, Extract message from TCB (Put there by QPost)  */
    OSTCBCur->OSTCBMsg      = (void *)0;
    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 message received                        */
}
/*$PAGE*/
/*
*********************************************************************************************************
*                                        POST MESSAGE TO A QUEUE
*
* Description: This function sends a message to a queue
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired queue
*
*              msg           is a pointer to the message to send.
*
* Returns    : OS_NO_ERR             The call was successful and the message was sent
*              OS_Q_FULL             If the queue cannot accept any more messages because it is full.
*              OS_ERR_EVENT_TYPE     If you didn't pass a pointer to a queue.
*              OS_ERR_PEVENT_NULL    If 'pevent' is a NULL pointer
*
* Note(s)    : As of V2.60, this function allows you to send NULL pointer messages.
*********************************************************************************************************
*/

#if OS_Q_POST_EN > 0
INT8U  OSQPost (OS_EVENT *pevent, void *msg)
{
    OS_Q      *pq;
#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 (OS_ERR_PEVENT_NULL);
    }
#endif
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {      /* Validate event block type                    */
        return (OS_ERR_EVENT_TYPE);
    }
    OS_ENTER_CRITICAL();
    if (pevent->OSEventGrp != 0) {                     /* See if any task pending on queue             */
        (void)OS_EventTaskRdy(pevent, msg, OS_STAT_Q); /* Ready highest priority task waiting on event */
        OS_EXIT_CRITICAL();
        OS_Sched();                                    /* Find highest priority task ready to run      */
        return (OS_NO_ERR);
    }
    pq = (OS_Q *)pevent->OSEventPtr;                   /* Point to queue control block                 */
    if (pq->OSQEntries >= pq->OSQSize) {               /* Make sure queue is not full                  */
        OS_EXIT_CRITICAL();
        return (OS_Q_FULL);
    }
    *pq->OSQIn++ = msg;                                /* Insert message into queue                    */
    pq->OSQEntries++;                                  /* Update the nbr of entries in the queue       */
    if (pq->OSQIn == pq->OSQEnd) {                     /* Wrap IN ptr if we are at end of queue        */
        pq->OSQIn = pq->OSQStart;
    }
    OS_EXIT_CRITICAL();
    return (OS_NO_ERR);
}
#endif
/*$PAGE*/
/*
*********************************************************************************************************
*                                   POST MESSAGE TO THE FRONT OF A QUEUE
*
* Description: This function sends a message to a queue but unlike OSQPost(), the message is posted at
*              the front instead of the end of the queue.  Using OSQPostFront() allows you to send
*              'priority' messages.
*
* Arguments  : pevent        is a pointer to the event control block associated with the desired queue
*
*              msg           is a pointer to the message to send.
*
* Returns    : OS_NO_ERR             The call was successful and the message was sent
*              OS_Q_FULL             If the queue cannot accept any more messages because it is full.
*              OS_ERR_EVENT_TYPE     If you didn't pass a pointer to a queue.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费视频在线观看| 日韩免费电影网站| 国产高清精品久久久久| 天天色综合成人网| 日本免费在线视频不卡一不卡二 | 亚洲欧洲日产国码二区| 久久综合五月天婷婷伊人| www.亚洲色图| 久久99精品视频| 秋霞av亚洲一区二区三| 狠狠色狠狠色综合系列| 国产成人在线视频播放| 色综合久久综合中文综合网| 欧美在线一区二区三区| 日韩美女天天操| 自拍偷拍亚洲综合| 亚洲1区2区3区4区| 国产精品456| 欧美三级视频在线播放| 精品福利在线导航| 亚洲小说春色综合另类电影| 麻豆91精品91久久久的内涵| 成人免费视频视频在线观看免费| 99国产精品99久久久久久| 欧美日韩不卡在线| 精品国产免费人成电影在线观看四季 | 无吗不卡中文字幕| 色婷婷激情综合| 久久综合九色综合欧美就去吻| 日韩理论在线观看| 高清不卡一区二区| 国产日韩欧美在线一区| 日日摸夜夜添夜夜添精品视频| 一本一本久久a久久精品综合麻豆| 日韩三级高清在线| 蜜桃久久av一区| 制服丝袜国产精品| 婷婷开心激情综合| 欧美人牲a欧美精品| 亚洲一区二区三区四区五区中文 | 九色综合国产一区二区三区| 欧美日韩免费一区二区三区| 夜色激情一区二区| 成人精品视频网站| 国产精品久久久久久久久果冻传媒 | 久国产精品韩国三级视频| 欧美成人一区二区三区| 美女一区二区三区| 精品不卡在线视频| 不卡区在线中文字幕| 亚洲精选在线视频| 欧美色倩网站大全免费| 日本午夜精品视频在线观看 | 亚洲电影激情视频网站| 欧美三级资源在线| 日本在线不卡一区| 精品盗摄一区二区三区| www.亚洲在线| 日韩av中文字幕一区二区三区| 日韩欧美电影一二三| 国产一区免费电影| 一区二区三区精品在线| 欧美电影影音先锋| www.一区二区| 国产麻豆午夜三级精品| 亚洲激情av在线| 国产色一区二区| 欧美精品在线一区二区| youjizz国产精品| 久久99国产精品麻豆| 亚洲免费电影在线| 欧美日韩日日夜夜| 国产一区免费电影| 日韩av电影天堂| 日韩高清不卡一区二区三区| 久久嫩草精品久久久精品| 欧美日韩一卡二卡三卡| 色噜噜狠狠色综合欧洲selulu| 国产一区欧美二区| 另类调教123区| 日韩高清不卡一区二区三区| 亚洲综合男人的天堂| 国产精品久久午夜夜伦鲁鲁| 欧美一级片在线| 欧美一级日韩不卡播放免费| 欧美日韩久久不卡| 777奇米成人网| 欧美一区二区三区爱爱| 日韩精品最新网址| 日韩午夜精品视频| 国产人妖乱国产精品人妖| 欧美精品一区二区三| 久久先锋影音av| 国产亚洲一区二区三区四区| 国产色爱av资源综合区| 国产色产综合色产在线视频 | 极品少妇xxxx精品少妇| 精品无人区卡一卡二卡三乱码免费卡| 精品一区二区av| 成人爱爱电影网址| 在线不卡一区二区| 欧美一区二区三区电影| 久久精品免费在线观看| 亚洲欧美韩国综合色| 久久国产精品99久久久久久老狼| 国产精品系列在线观看| 91玉足脚交白嫩脚丫在线播放| 色婷婷亚洲精品| 久久久三级国产网站| 亚洲一区二区三区在线看| 亚洲国产成人va在线观看天堂| 亚洲一区在线视频| 国产精品一区二区久久精品爱涩| 99re这里都是精品| 国产日韩精品一区二区三区在线| 亚洲男人电影天堂| 国产成人欧美日韩在线电影| 日本久久一区二区三区| 欧美韩国一区二区| 青青青伊人色综合久久| 色综合久久中文字幕| 中文字幕精品综合| 国产盗摄一区二区三区| 日韩欧美国产一二三区| 日韩在线观看一区二区| 91色视频在线| 亚洲欧美日韩国产手机在线| 国产一区二区在线观看视频| 日韩一级完整毛片| 美女在线一区二区| 日韩视频一区二区在线观看| 视频一区二区三区入口| 日韩你懂的在线播放| 日韩激情视频网站| 日韩欧美久久久| 国产高清不卡一区二区| 久久久.com| 91亚洲男人天堂| 亚洲在线免费播放| 91麻豆精品国产自产在线| 日韩激情av在线| 久久精品男人天堂av| 99久久国产免费看| 午夜精品福利一区二区三区蜜桃| 91精品国产综合久久香蕉的特点| 日韩成人伦理电影在线观看| 欧美一区日韩一区| 成人高清av在线| 日本伊人午夜精品| 中国av一区二区三区| 欧美日韩国产免费| 国产精品小仙女| 午夜久久久久久久久| 精品三级av在线| 欧美日韩国产一级片| 亚洲免费在线观看视频| 欧美久久久久久久久| 国产伦精品一区二区三区免费| 亚洲欧美日韩中文字幕一区二区三区 | 菠萝蜜视频在线观看一区| 亚洲图片欧美视频| 亚洲欧美中日韩| 国产欧美日韩一区二区三区在线观看| 91小宝寻花一区二区三区| 国内精品第一页| 麻豆成人久久精品二区三区红| 亚洲欧美日韩国产一区二区三区| 欧美xxxxxxxxx| 精品少妇一区二区三区日产乱码| 色婷婷亚洲综合| 91丨porny丨最新| 色综合天天综合色综合av| av中文字幕不卡| 91丝袜高跟美女视频| 99精品偷自拍| 国产成人一区在线| 国产在线国偷精品免费看| 久久精品国产免费看久久精品| 天堂久久久久va久久久久| 日韩精品五月天| 日韩av网站在线观看| 蜜臀av性久久久久av蜜臀妖精| 日韩中文字幕91| 黑人巨大精品欧美黑白配亚洲| 极品少妇xxxx偷拍精品少妇| 麻豆精品一二三| av在线免费不卡| 色婷婷激情一区二区三区| 欧美日韩1234| 国产香蕉久久精品综合网| 中文字幕一区免费在线观看| 1024成人网| 美女脱光内衣内裤视频久久网站| 韩国av一区二区| 成人av高清在线| 日韩精品一区二区三区在线观看 | 三级精品在线观看| 奇米精品一区二区三区在线观看 | 日韩亚洲欧美成人一区| 国产亚洲一区字幕|