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

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

?? os_q.c

?? UcOS2.76在ATMEL AT91RM9200 ARM9上的移植代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
#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;
             return ((OS_EVENT *)0);                       /* Queue has been deleted                   */

        default:
             OS_EXIT_CRITICAL();
             *err = OS_ERR_INVALID_OPT;
             return (pevent);
    }
}
#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;



    cpu_sr = 0;                                       /* Prevent compiler warning                      */
#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;



    cpu_sr = 0;                                  /* Prevent compiler warning                           */
#endif    
    if (OSIntNesting > 0) {                      /* See if called from ISR ...                         */
        *err = OS_ERR_PEND_ISR;                  /* ... can't PEND from an ISR                         */
        return ((void *)0);
    }
#if OS_ARG_CHK_EN > 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
    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;



    cpu_sr = 0;                                        /* Prevent compiler warning                     */
#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 != 0x00) {                  /* 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.
*              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_FRONT_EN > 0
INT8U  OSQPostFront (OS_EVENT *pevent, void *msg)
{
    OS_Q      *pq;
#if OS_CRITICAL_METHOD == 3                           /* Allocate storage for CPU status register      */
    OS_CPU_SR  cpu_sr;



    cpu_sr = 0;                                       /* Prevent compiler warning                      */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合久久综合网| 欧美成人三级电影在线| 午夜电影网亚洲视频| 精品蜜桃在线看| 91亚洲精华国产精华精华液| 亚洲国产综合色| 欧美一区永久视频免费观看| 狠狠色狠狠色综合系列| 亚洲男人都懂的| 久久久久久毛片| 欧美日韩精品电影| av在线播放不卡| 欧美日韩国产三级| 国产精品天干天干在线综合| 欧美一区二区三区公司| 在线视频一区二区三| 国产精品18久久久久久久久| 午夜精品一区二区三区电影天堂 | 亚洲丝袜美腿综合| 久久久久久久综合日本| 欧美电影免费观看高清完整版| 色女孩综合影院| 色欧美乱欧美15图片| 日本黄色一区二区| 一本色道久久加勒比精品| 91在线国产观看| 欧美亚日韩国产aⅴ精品中极品| 国产 日韩 欧美大片| 免费精品99久久国产综合精品| 亚洲gay无套男同| 午夜电影久久久| 国产一区欧美一区| 91视视频在线直接观看在线看网页在线看| 国产夫妻精品视频| 91同城在线观看| 欧美日韩激情在线| 欧美国产综合色视频| 亚洲一区二区美女| 国产成人精品免费| 欧美亚日韩国产aⅴ精品中极品| 欧美日韩精品三区| 久久亚洲免费视频| 亚洲h在线观看| 懂色一区二区三区免费观看| 欧美丝袜丝交足nylons图片| 99久久99久久久精品齐齐| 日韩一区二区高清| 亚洲男人的天堂av| 国产精品影视在线观看| 色先锋aa成人| 国产欧美日韩在线| 国产精品12区| 精品福利一二区| 视频一区视频二区中文字幕| 成人精品国产一区二区4080| 精品国产一区二区三区不卡 | 欧美国产禁国产网站cc| 五月激情六月综合| 一本久久a久久免费精品不卡| 亚洲精品一区二区三区蜜桃下载| 亚洲v日本v欧美v久久精品| 91首页免费视频| 国产精品久久久久久久久快鸭| 一本色道亚洲精品aⅴ| 久久久精品欧美丰满| 国产自产2019最新不卡| 欧美本精品男人aⅴ天堂| 九九久久精品视频 | www久久久久| 丁香网亚洲国际| 国产精品无遮挡| 一本色道久久综合亚洲91 | 日韩av网站免费在线| 日韩欧美黄色影院| 国产一区二区三区四区五区入口 | 精品久久五月天| 成人激情午夜影院| 一区二区成人在线观看| 欧美一级精品在线| 国产精品18久久久| 亚洲成人综合在线| 久久精品视频一区二区三区| 9人人澡人人爽人人精品| 亚洲成人免费在线| 欧美激情综合五月色丁香| 欧美色老头old∨ideo| 麻豆极品一区二区三区| 国产精品久久久久久久久免费樱桃 | 免费高清不卡av| 亚洲欧美日韩系列| 久久综合色一综合色88| 91久久人澡人人添人人爽欧美| 麻豆精品一区二区综合av| 亚洲精品国产无天堂网2021| 欧美不卡在线视频| 欧美三级电影一区| 粉嫩av一区二区三区| 亚洲国产另类av| 亚洲欧美日韩久久精品| 国产欧美视频一区二区| 911精品产国品一二三产区| 在线观看av一区| 欧洲一区二区av| 日本电影亚洲天堂一区| 一本色道综合亚洲| 国产精品99久| 国产一区二区不卡老阿姨| 久热成人在线视频| 日日摸夜夜添夜夜添亚洲女人| 性感美女久久精品| 亚洲激情成人在线| 亚洲尤物视频在线| 蜜臀精品久久久久久蜜臀| 美女诱惑一区二区| 国产成人一区在线| 在线观看免费视频综合| 欧美三级日韩三级| 日韩欧美成人一区二区| 国产亚洲欧洲一区高清在线观看| 国产日韩亚洲欧美综合| 亚洲精品乱码久久久久久| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 中文字幕欧美国产| 亚洲成人av资源| 成人综合婷婷国产精品久久免费| 成人av资源在线观看| 欧美伊人久久久久久久久影院 | 国产福利精品一区| 欧美日韩中字一区| 久久众筹精品私拍模特| 亚洲日本青草视频在线怡红院| 亚洲自拍偷拍图区| 国产福利一区二区三区视频| 91精品福利视频| 久久精品亚洲精品国产欧美| 亚洲综合丝袜美腿| 国产91精品一区二区麻豆网站 | 亚洲高清免费视频| 91激情在线视频| 国产精品伦理在线| 精品影视av免费| 欧美精品电影在线播放| 中文字幕成人av| 成人高清av在线| 国产女人18毛片水真多成人如厕| 婷婷国产v国产偷v亚洲高清| 色94色欧美sute亚洲线路二| 亚洲美女淫视频| 国产一区二区三区综合| 午夜日韩在线观看| 日本韩国一区二区三区| 国产一区二三区| 一区二区久久久| 欧美国产乱子伦| 国产精品1区2区3区在线观看| 久久女同互慰一区二区三区| 免费成人av资源网| 久久伊人蜜桃av一区二区| 亚洲成人动漫在线观看| 欧美偷拍一区二区| 亚洲一区在线观看网站| 欧美精品色综合| 免费观看久久久4p| 国产日产欧美一区二区三区| 国产不卡高清在线观看视频| 综合av第一页| 精品久久久久久久久久久久久久久| 国产一区二区三区精品视频| 亚洲综合一区二区| 久久精品夜色噜噜亚洲aⅴ| 91久久精品网| av不卡在线播放| 日本不卡免费在线视频| 亚洲一区二区在线播放相泽| 久久综合狠狠综合| 7878成人国产在线观看| 色综合天天天天做夜夜夜夜做| 久久99精品视频| 日韩国产在线观看一区| 国产精品不卡在线| 亚洲国产日韩av| 久久品道一品道久久精品| 6080国产精品一区二区| 欧美日韩一卡二卡| 欧美日韩国产综合一区二区三区| 欧美视频在线一区| 欧美日韩高清不卡| 色综合天天综合狠狠| 久久久久久久网| 91麻豆精品国产91久久久| 日韩欧美成人激情| 亚洲最大色网站| av不卡在线观看| 久久综合久久综合亚洲| 亚洲日本免费电影| 亚洲高清不卡在线观看| 麻豆专区一区二区三区四区五区| 国产一区二区三区四区五区入口| 色老汉一区二区三区| 欧美日韩精品是欧美日韩精品|