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

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

?? os_q.c

?? PIC18F452下的uCOS2移植成功代碼+MPLAB IDE V8.0的項目文件。結構非常精簡
?? C
?? 第 1 頁 / 共 3 頁
字號:
             *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
*********************************************************************************************************
*/

#if OS_Q_FLUSH_EN > 0
INT8U  OSQFlush (OS_EVENT *pevent)
{
#if OS_CRITICAL_METHOD == 3                           /* Allocate storage for CPU status register      */
    OS_CPU_SR  cpu_sr;
#endif
    OS_Q      *pq;


#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 no message was received or,
*                            if 'pevent' is a NULL pointer or,
*                            if you didn't pass a pointer to a queue.
*********************************************************************************************************
*/

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


    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->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();
    msg = OSTCBCur->OSTCBMsg;
    if (msg != (void *)0) {                      /* Did we get a message?                              */
        OSTCBCur->OSTCBMsg      = (void *)0;     /* Extract message from TCB (Put there by QPost)      */
        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                            */
    }
    OS_EventTO(pevent);                          /* Timed out                                          */
    OS_EXIT_CRITICAL();
    *err = OS_TIMEOUT;                           /* Indicate a timeout occured                         */
    return ((void *)0);                          /* No 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.  You MUST NOT send a NULL pointer.
*
* 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
*              OS_ERR_POST_NULL_PTR  If you are attempting to post a NULL pointer
*********************************************************************************************************
*/

#if OS_Q_POST_EN > 0
INT8U  OSQPost (OS_EVENT *pevent, void *msg)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif
    OS_Q      *pq;


#if OS_ARG_CHK_EN > 0
    if (pevent == (OS_EVENT *)0) {                    /* Validate 'pevent'                             */
        return (OS_ERR_PEVENT_NULL);
    }
    if (msg == (void *)0) {                           /* Make sure we are not posting a NULL pointer   */
        return (OS_ERR_POST_NULL_PTR);
    }
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {     /* Validate event block type                     */
        return (OS_ERR_EVENT_TYPE);
    }
#endif
    OS_ENTER_CRITICAL();
    if (pevent->OSEventGrp != 0x00) {                 /* See if any task pending on queue              */
        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.  You MUST NOT send a NULL pointer.
*
* 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
*              OS_ERR_POST_NULL_PTR  If you are attempting to post to a non queue.
*********************************************************************************************************
*/

#if OS_Q_POST_FRONT_EN > 0
INT8U  OSQPostFront (OS_EVENT *pevent, void *msg)
{
#if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
    OS_CPU_SR  cpu_sr;
#endif
    OS_Q      *pq;


#if OS_ARG_CHK_EN > 0
    if (pevent == (OS_EVENT *)0) {                    /* Validate 'pevent'                             */
        return (OS_ERR_PEVENT_NULL);
    }
    if (msg == (void *)0) {                           /* Make sure we are not posting a NULL pointer   */
        return (OS_ERR_POST_NULL_PTR);
    }
    if (pevent->OSEventType != OS_EVENT_TYPE_Q) {     /* Validate event block type                     */
        return (OS_ERR_EVENT_TYPE);
    }
#endif
    OS_ENTER_CRITICAL();
    if (pevent->OSEventGrp != 0x00) {                 /* See if any task pending on queue              */
        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);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
最近日韩中文字幕| 久久精品人人爽人人爽| 色综合久久88色综合天天免费| 国产一区二区三区日韩| 久久精品国产亚洲aⅴ| 日本欧美一区二区三区| 蜜桃久久久久久| 国产精一区二区三区| 国产成人av一区二区三区在线观看| 国产一区二区精品在线观看| 国产福利精品一区| 91亚洲男人天堂| 欧美日韩卡一卡二| 精品国产亚洲在线| 国产精品毛片久久久久久| 亚洲精品高清在线| 欧美a级一区二区| 狠狠色综合日日| 91小视频免费看| 欧美老肥妇做.爰bbww| 日韩亚洲欧美在线| 日本一区二区三区四区| 亚洲日本在线看| 日韩电影在线免费观看| 国产精品123区| 欧美天堂一区二区三区| 欧美精品一区二| 亚洲你懂的在线视频| 日韩成人免费在线| 成人av在线播放网站| 欧美另类高清zo欧美| 欧美国产激情一区二区三区蜜月| 亚洲久草在线视频| 肉丝袜脚交视频一区二区| 国内精品久久久久影院一蜜桃| 成人在线综合网站| 91精品国产色综合久久不卡电影 | 91在线高清观看| 8v天堂国产在线一区二区| 久久综合久久综合亚洲| 亚洲永久免费av| 国产馆精品极品| 欧美一二区视频| 亚洲乱码中文字幕| 国产成人免费在线| 日韩久久久精品| 亚洲电影一区二区| 懂色av中文一区二区三区| 7777精品伊人久久久大香线蕉 | 一区二区三区在线影院| 国产一区二区不卡| 欧美精品乱人伦久久久久久| 亚洲丝袜制服诱惑| 国产美女娇喘av呻吟久久| 欧美精品在线观看一区二区| 一区二区三国产精华液| www.成人在线| 久久久午夜电影| 免费成人在线视频观看| 欧美另类高清zo欧美| 亚洲黄色小说网站| 日本电影欧美片| 亚洲欧洲国产专区| 99久免费精品视频在线观看| 国产午夜亚洲精品不卡| 国产一区二区在线看| 精品国产伦一区二区三区观看方式 | 极品少妇一区二区三区精品视频| 91久久香蕉国产日韩欧美9色| 国产精品无圣光一区二区| 国产黄色精品网站| 国产午夜久久久久| 丁香亚洲综合激情啪啪综合| 国产亚洲欧美中文| 高清国产一区二区三区| 国产日韩精品久久久| 国产成人在线电影| 亚洲国产精品传媒在线观看| 成人午夜视频免费看| 国产日韩精品一区二区三区 | 午夜精品aaa| 欧美绝品在线观看成人午夜影视| 亚洲综合视频网| 欧美精品久久一区| 精品一区二区三区在线播放视频| 精品久久一区二区三区| 国产一区二区h| 国产精品久久一卡二卡| 91麻豆产精品久久久久久| 亚洲一区二区在线观看视频| 欧美精品第1页| 国产一区二区三区四区五区美女| 国产午夜三级一区二区三| www.欧美色图| 性久久久久久久| 精品理论电影在线| 不卡区在线中文字幕| 亚洲人成网站在线| 欧美性感一区二区三区| 美脚の诱脚舐め脚责91 | 99国产精品国产精品毛片| 亚洲欧美一区二区不卡| 制服.丝袜.亚洲.另类.中文| 国内一区二区在线| 亚洲素人一区二区| 91精品国产综合久久小美女| 国产不卡在线一区| 亚洲国产精品麻豆| 久久久久久久久久看片| 欧美亚洲日本国产| 国内一区二区在线| 亚洲一区中文在线| 国产丝袜欧美中文另类| 欧美日韩免费一区二区三区| 国内精品久久久久影院色| 中文字幕一区av| 欧美不卡一二三| 欧美性淫爽ww久久久久无| 国产一区二区三区不卡在线观看| 亚洲激情第一区| 久久久精品免费免费| 欧美精品第一页| 色综合亚洲欧洲| 国产精华液一区二区三区| 亚洲高清免费观看| 亚洲男人天堂av网| 国产日韩欧美综合在线| 欧美乱妇一区二区三区不卡视频 | 亚洲乱码国产乱码精品精小说| 欧美一级高清片| 欧美日韩一区视频| 97久久超碰国产精品电影| 国产老妇另类xxxxx| 日产欧产美韩系列久久99| 亚洲综合一区二区精品导航| 国产精品高潮久久久久无| 欧美精品一区视频| 欧美一区二区三区成人| 欧美吻胸吃奶大尺度电影| 一本到一区二区三区| a在线欧美一区| 丁香激情综合国产| 成人性色生活片| 国产很黄免费观看久久| 国产美女一区二区三区| 老司机免费视频一区二区三区| 亚洲成人精品在线观看| 亚洲成人福利片| 午夜久久久久久久久| 亚洲成人av中文| 午夜精品一区在线观看| 日韩av一区二区在线影视| 蜜桃视频一区二区| 久久激情五月婷婷| 国产一区二区0| 成人天堂资源www在线| caoporm超碰国产精品| 91一区二区在线观看| 欧美中文字幕一区二区三区| 欧美视频中文字幕| 555www色欧美视频| 久久久一区二区三区| 国产精品美女www爽爽爽| 亚洲欧美日本在线| 亚洲v日本v欧美v久久精品| 日本 国产 欧美色综合| 精品午夜久久福利影院| 成人av综合在线| 在线观看亚洲专区| 欧美不卡一区二区三区| 国产欧美日韩另类视频免费观看| 中文字幕一区av| 视频一区免费在线观看| 精品一区二区在线视频| 成人av网站免费| 4438亚洲最大| 国产精品伦一区| 天天免费综合色| 国产成人午夜精品影院观看视频 | 91麻豆产精品久久久久久| 欧美日韩视频在线第一区| 精品美女在线播放| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 亚洲日本va午夜在线影院| 午夜电影网一区| 国产久卡久卡久卡久卡视频精品| 91视频国产资源| 精品国产一区a| 亚洲曰韩产成在线| 豆国产96在线|亚洲| 91麻豆精品国产91久久久久久| 久久久.com| 天堂一区二区在线免费观看| 成人激情图片网| 欧美一区二区免费观在线| 日韩理论片在线| 国产激情视频一区二区三区欧美| 欧美视频三区在线播放| 日本一区二区三区国色天香 | 91丝袜美腿高跟国产极品老师|