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

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

?? os_q.c

?? 本源碼是用ARM9 2410開發的OLED液晶驅動開發代碼
?? 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一区二区三区免费野_久草精品视频
亚洲国产你懂的| 精品国精品国产| 99精品热视频| 成人h版在线观看| 懂色av一区二区在线播放| 精品一二三四区| 久国产精品韩国三级视频| 久久国产精品区| 激情久久五月天| 国产不卡在线播放| 成人激情免费网站| 91视频在线看| 欧美在线免费播放| 欧美日韩精品一区二区三区蜜桃| 欧美日韩国产另类一区| 日韩限制级电影在线观看| 2023国产精品自拍| 国产精品久久久久婷婷二区次| 日韩一区日韩二区| 日韩中文字幕1| 老汉av免费一区二区三区| 国产成人精品一区二区三区网站观看| 国产激情一区二区三区| 91美女精品福利| 欧美精品18+| 国产亚洲欧美在线| 亚洲欧美一区二区三区孕妇| 亚洲国产精品视频| 国模无码大尺度一区二区三区| 国产99精品在线观看| 色久综合一二码| 欧美一区二区福利视频| 2014亚洲片线观看视频免费| 欧美精品在线观看播放| 亚洲女人****多毛耸耸8| 亚洲猫色日本管| 午夜精品一区二区三区三上悠亚 | 亚洲成人你懂的| 亚瑟在线精品视频| 国产精品77777竹菊影视小说| aa级大片欧美| 欧美电影免费观看高清完整版在线观看| 久久久一区二区三区| 亚洲国产精品综合小说图片区| 国模少妇一区二区三区| 91福利精品视频| 久久久久亚洲蜜桃| 亚洲成人精品影院| 99九九99九九九视频精品| 日韩欧美国产小视频| 一区二区三区鲁丝不卡| 国产福利一区在线| 日韩视频国产视频| 亚洲一区二区三区四区在线观看| 国产一区二区日韩精品| 欧美日本国产视频| 亚洲婷婷综合色高清在线| 麻豆精品在线观看| 欧美日韩国产免费一区二区| 亚洲图片你懂的| 国产成人免费高清| 亚洲精品在线免费观看视频| 亚洲va韩国va欧美va精品 | 91免费版在线看| 久久精品视频免费| 国产综合色视频| 日韩精品一区二区三区视频播放| 亚洲激情男女视频| zzijzzij亚洲日本少妇熟睡| 久久九九国产精品| 国产精一区二区三区| 欧美精品一区二区三区很污很色的| 亚洲成av人综合在线观看| 欧美在线不卡一区| 亚洲综合一区二区精品导航| 在线观看一区二区视频| 亚洲一区二三区| 欧美日韩在线观看一区二区| 亚洲一区日韩精品中文字幕| 欧美三级三级三级爽爽爽| 一区二区三区精品久久久| 欧美丝袜丝交足nylons| 亚洲一区av在线| 欧美日韩精品一区二区三区四区 | 亚洲欧美另类综合偷拍| 99视频有精品| 亚洲天堂精品在线观看| 色综合久久88色综合天天6| 亚洲理论在线观看| 欧美色精品在线视频| 免费成人在线影院| 久久综合丝袜日本网| 国产91精品精华液一区二区三区| 国产欧美中文在线| 色综合一区二区三区| 亚洲第一会所有码转帖| 欧美一级片在线| 国产精品一区二区男女羞羞无遮挡| 国产亚洲人成网站| 欧美综合一区二区| 久久99国产精品麻豆| 国产精品久久久久久久第一福利| 一本大道久久a久久精品综合| 亚洲国产日韩精品| 国产亚洲欧美一区在线观看| 91蜜桃网址入口| 蜜臀av性久久久久蜜臀aⅴ四虎| 久久久久久久久免费| 在线这里只有精品| 久久电影网电视剧免费观看| ...xxx性欧美| 日韩欧美亚洲国产精品字幕久久久| 国产电影精品久久禁18| 亚洲大型综合色站| 国产日韩欧美电影| 91麻豆精品国产| www.日本不卡| 激情久久五月天| 亚洲韩国一区二区三区| 欧美精品一区二区精品网| 91福利社在线观看| 国产大陆亚洲精品国产| 天天av天天翘天天综合网| 日本一区二区三区国色天香| 欧美日本视频在线| 91免费在线看| 国产精品69毛片高清亚洲| 午夜不卡av在线| 亚洲色图都市小说| 久久新电视剧免费观看| 欧美日韩中文国产| 91日韩在线专区| 国产精品一区久久久久| 蜜臀av性久久久久蜜臀aⅴ流畅 | 久久网站热最新地址| 91行情网站电视在线观看高清版| 国产精品一区免费视频| 久久不见久久见免费视频1| 亚洲国产欧美日韩另类综合 | 在线亚洲高清视频| 国产成人一级电影| 美女性感视频久久| 日韩成人伦理电影在线观看| 亚洲一区视频在线| 亚洲第一搞黄网站| 亚洲精品国产视频| 亚洲色图.com| 亚洲欧美日韩久久| 亚洲视频一二三区| 国产精品久久网站| 亚洲色图色小说| 中文字幕综合网| 亚洲免费三区一区二区| 亚洲视频在线一区二区| 亚洲免费观看高清完整版在线观看熊| 国产目拍亚洲精品99久久精品| 国产性色一区二区| 国产精品欧美一级免费| 中文天堂在线一区| 亚洲欧美一区二区三区极速播放| 亚洲欧美电影院| 亚洲一区电影777| 日韩精品国产欧美| 蜜桃av一区二区| 精品一二三四区| 国产一区二区三区蝌蚪| 国产成a人无v码亚洲福利| 成人美女视频在线观看18| 97超碰欧美中文字幕| 欧洲国内综合视频| 91精品在线观看入口| 日韩精品一区二区三区视频播放 | 中文字幕在线观看一区二区| 亚洲视频电影在线| 午夜视频一区二区| 久久成人免费网| 成人激情黄色小说| 91极品美女在线| 日韩欧美区一区二| 国产精品久久久久久户外露出 | 久久午夜老司机| 国产精品国产a| 亚洲一二三区视频在线观看| 免费观看91视频大全| 成人免费av资源| 337p亚洲精品色噜噜噜| 国产日韩三级在线| 亚洲尤物在线视频观看| 久久av老司机精品网站导航| 不卡的电影网站| 91精品午夜视频| 国产精品久久99| 日本女人一区二区三区| 国产精品中文有码| 欧美写真视频网站| 国产午夜久久久久| 日本免费在线视频不卡一不卡二| 不卡大黄网站免费看| 精品国产一区二区三区久久影院 | 日韩一区二区电影网|