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

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

?? os_q.c

?? UCOS II V2.80 移植到freescale的qe128上面的源代碼。并且包含UCOS II V2.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一区二区三区免费野_久草精品视频
欧美一二三四区在线| 日本韩国欧美在线| 久久免费视频色| 国产成人精品一区二区三区四区| 国产亚洲污的网站| 99视频精品全部免费在线| 亚洲黄色录像片| 日韩欧美国产小视频| 国产毛片精品一区| 亚洲欧美一区二区久久| 欧美顶级少妇做爰| 国产精品一区不卡| 一区二区三区中文字幕| 日韩欧美一二区| 99视频一区二区| 青青青爽久久午夜综合久久午夜| 久久五月婷婷丁香社区| 92精品国产成人观看免费| 日日噜噜夜夜狠狠视频欧美人 | 国产一区二区三区四区五区入口| 国产午夜亚洲精品午夜鲁丝片| 91亚洲精品乱码久久久久久蜜桃| 一区二区日韩电影| 精品国产亚洲在线| 色女孩综合影院| 精品在线播放免费| 一区二区三区在线观看动漫| 日韩视频中午一区| 色妹子一区二区| 国产另类ts人妖一区二区| 亚洲一区二区三区四区在线观看| 日韩精品一区二| 欧美在线一区二区| 国产91富婆露脸刺激对白| 天天色综合天天| 国产精品电影一区二区| 欧美www视频| 精品视频999| 99riav一区二区三区| 狠狠狠色丁香婷婷综合激情| 亚洲一卡二卡三卡四卡五卡| 国产精品色在线观看| 日韩三级在线免费观看| 色久综合一二码| 成人一区二区三区视频在线观看| 日本aⅴ亚洲精品中文乱码| 国产真实乱子伦精品视频| 亚洲动漫第一页| 一区在线观看视频| 欧美极品美女视频| 久久久久久久久久久久电影| 欧美日韩国产免费| 色天使色偷偷av一区二区| 丰满亚洲少妇av| 韩国av一区二区三区四区| 日韩电影免费一区| 亚洲精品成人少妇| 中文字幕一区二区不卡| 中文一区在线播放| 久久久精品蜜桃| 精品免费国产一区二区三区四区| 欧美日韩国产三级| 欧美乱妇一区二区三区不卡视频| 91视频国产观看| 91在线丨porny丨国产| www.成人在线| 99久久婷婷国产| 99久久99精品久久久久久 | 男女性色大片免费观看一区二区 | 亚洲日本在线视频观看| 中文字幕av资源一区| 中国色在线观看另类| 国产精品美日韩| 亚洲欧洲日产国产综合网| 自拍偷自拍亚洲精品播放| 最新中文字幕一区二区三区| 日韩理论在线观看| 亚洲在线免费播放| 亚洲午夜在线电影| 日韩国产欧美在线观看| 日韩在线观看一区二区| 六月丁香婷婷久久| 国产伦精品一区二区三区视频青涩| 国产美女在线观看一区| 粉嫩aⅴ一区二区三区四区五区 | 在线观看免费亚洲| 欧美日韩亚洲综合| 欧美mv日韩mv国产| 久久久国产一区二区三区四区小说 | 国产高清成人在线| 成人av电影观看| 91福利国产成人精品照片| 欧美视频你懂的| 日韩午夜激情av| 国产色一区二区| 亚洲欧美另类久久久精品| 午夜精品一区二区三区三上悠亚| 麻豆成人在线观看| 成人免费高清在线| 欧美性欧美巨大黑白大战| 精品日韩在线观看| 亚洲嫩草精品久久| 奇米四色…亚洲| 成人免费看视频| 欧美精品粉嫩高潮一区二区| 亚洲精品在线电影| 亚洲最新在线观看| 精品亚洲欧美一区| 91丨porny丨首页| 欧美一级黄色录像| 成人在线视频首页| 欧美日韩一区二区三区高清| 欧美r级电影在线观看| 亚洲欧美日韩一区二区三区在线观看| 日韩1区2区日韩1区2区| 99视频精品在线| 精品免费日韩av| 亚洲午夜久久久久久久久电影院| 韩国女主播一区| 精品视频在线看| 亚洲国产精品av| 日韩国产欧美三级| 色又黄又爽网站www久久| 欧美mv日韩mv国产网站app| 一区二区三区色| 国产成人午夜精品影院观看视频| 欧美性生活一区| ...中文天堂在线一区| 国产在线精品一区二区不卡了| 欧美性一二三区| 成人免费在线播放视频| 久久99久久精品| 欧美精品少妇一区二区三区| 成人欧美一区二区三区白人| 久久99精品久久久久久动态图 | 中文字幕乱码亚洲精品一区| 日本aⅴ亚洲精品中文乱码| 色网综合在线观看| 国产亚洲一二三区| 精品一区二区久久久| 欧美精品日韩一区| 一区二区三区四区视频精品免费| 国产精品亚洲а∨天堂免在线| 91麻豆精品国产自产在线观看一区| 亚洲乱码中文字幕| 99久久国产综合精品麻豆| 欧美国产精品中文字幕| 激情文学综合插| 欧美电视剧在线观看完整版| 午夜不卡在线视频| 欧美色窝79yyyycom| 一区二区在线观看免费视频播放| 成人午夜激情在线| 中文字幕欧美国产| 成人激情免费视频| 国产精品美女久久福利网站| 国产成人精品免费网站| 久久理论电影网| 国产自产高清不卡| 国产欧美一区二区精品秋霞影院| 国产一区啦啦啦在线观看| 久久品道一品道久久精品| 国产在线精品不卡| 欧美激情综合在线| 白白色 亚洲乱淫| 亚洲男同1069视频| 色婷婷综合久久久久中文一区二区| 综合网在线视频| 欧美在线观看视频一区二区| 亚洲国产中文字幕在线视频综合 | 91伊人久久大香线蕉| 亚洲欧洲av色图| 欧美在线视频全部完| 午夜av一区二区三区| 91精品国产色综合久久ai换脸| 日本不卡高清视频| 精品国产区一区| 成人综合在线观看| 亚洲男人的天堂一区二区| 91极品视觉盛宴| 日韩精品视频网| 久久久一区二区| 91污在线观看| 日韩精品久久久久久| 精品国产不卡一区二区三区| 成人高清免费观看| 一区2区3区在线看| 一区二区三区不卡视频| 91精品国产色综合久久不卡蜜臀| 亚洲成人一区二区| 欧美一级生活片| 国产高清不卡二三区| 日韩伦理av电影| 正在播放亚洲一区| 成人午夜精品在线| 午夜av一区二区三区| 国产区在线观看成人精品 | 精品一区二区三区在线观看 | 日韩三级在线观看| 99国产精品国产精品毛片|