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

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

?? croutine.h

?? freescale k40/k60 freertos-uip 例程
?? H
?? 第 1 頁 / 共 2 頁
字號:
 // a queue.
 static void prvCoRoutineFlashTask( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
 {
 // Variables in co-routines must be declared static if they must maintain value across a blocking call.
 static portBASE_TYPE xNumberToPost = 0;
 static portBASE_TYPE xResult;

    // Co-routines must begin with a call to crSTART().
    crSTART( xHandle );

    for( ;; )
    {
        // This assumes the queue has already been created.
        crQUEUE_SEND( xHandle, xCoRoutineQueue, &xNumberToPost, NO_DELAY, &xResult );

        if( xResult != pdPASS )
        {
            // The message was not posted!
        }

        // Increment the number to be posted onto the queue.
        xNumberToPost++;

        // Delay for 100 ticks.
        crDELAY( xHandle, 100 );
    }

    // Co-routines must end with a call to crEND().
    crEND();
 }</pre>
 * \defgroup crQUEUE_SEND crQUEUE_SEND
 * \ingroup Tasks
 */
#define crQUEUE_SEND( xHandle, pxQueue, pvItemToQueue, xTicksToWait, pxResult )			\
{																						\
	*pxResult = xQueueCRSend( pxQueue, pvItemToQueue, xTicksToWait );					\
	if( *pxResult == errQUEUE_BLOCKED )													\
	{																					\
		crSET_STATE0( xHandle );														\
		*pxResult = xQueueCRSend( pxQueue, pvItemToQueue, 0 );							\
	}																					\
	if( *pxResult == errQUEUE_YIELD )													\
	{																					\
		crSET_STATE1( xHandle );														\
		*pxResult = pdPASS;																\
	}																					\
}

/**
 * croutine. h
 * <pre>
  crQUEUE_RECEIVE(
                     xCoRoutineHandle xHandle,
                     xQueueHandle pxQueue,
                     void *pvBuffer,
                     portTickType xTicksToWait,
                     portBASE_TYPE *pxResult
                 )</pre>
 *
 * The macro's crQUEUE_SEND() and crQUEUE_RECEIVE() are the co-routine
 * equivalent to the xQueueSend() and xQueueReceive() functions used by tasks.
 *
 * crQUEUE_SEND and crQUEUE_RECEIVE can only be used from a co-routine whereas
 * xQueueSend() and xQueueReceive() can only be used from tasks.
 *
 * crQUEUE_RECEIVE can only be called from the co-routine function itself - not
 * from within a function called by the co-routine function.  This is because
 * co-routines do not maintain their own stack.
 *
 * See the co-routine section of the WEB documentation for information on
 * passing data between tasks and co-routines and between ISR's and
 * co-routines.
 *
 * @param xHandle The handle of the calling co-routine.  This is the xHandle
 * parameter of the co-routine function.
 *
 * @param pxQueue The handle of the queue from which the data will be received.
 * The handle is obtained as the return value when the queue is created using
 * the xQueueCreate() API function.
 *
 * @param pvBuffer The buffer into which the received item is to be copied.
 * The number of bytes of each queued item is specified when the queue is
 * created.  This number of bytes is copied into pvBuffer.
 *
 * @param xTickToDelay The number of ticks that the co-routine should block
 * to wait for data to become available from the queue, should data not be
 * available immediately. The actual amount of time this equates to is defined
 * by configTICK_RATE_HZ (set in FreeRTOSConfig.h).  The constant
 * portTICK_RATE_MS can be used to convert ticks to milliseconds (see the
 * crQUEUE_SEND example).
 *
 * @param pxResult The variable pointed to by pxResult will be set to pdPASS if
 * data was successfully retrieved from the queue, otherwise it will be set to
 * an error code as defined within ProjDefs.h.
 *
 * Example usage:
 <pre>
 // A co-routine receives the number of an LED to flash from a queue.  It
 // blocks on the queue until the number is received.
 static void prvCoRoutineFlashWorkTask( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
 {
 // Variables in co-routines must be declared static if they must maintain value across a blocking call.
 static portBASE_TYPE xResult;
 static unsigned portBASE_TYPE uxLEDToFlash;

    // All co-routines must start with a call to crSTART().
    crSTART( xHandle );

    for( ;; )
    {
        // Wait for data to become available on the queue.
        crQUEUE_RECEIVE( xHandle, xCoRoutineQueue, &uxLEDToFlash, portMAX_DELAY, &xResult );

        if( xResult == pdPASS )
        {
            // We received the LED to flash - flash it!
            vParTestToggleLED( uxLEDToFlash );
        }
    }

    crEND();
 }</pre>
 * \defgroup crQUEUE_RECEIVE crQUEUE_RECEIVE
 * \ingroup Tasks
 */
#define crQUEUE_RECEIVE( xHandle, pxQueue, pvBuffer, xTicksToWait, pxResult )			\
{																						\
	*pxResult = xQueueCRReceive( pxQueue, pvBuffer, xTicksToWait );						\
	if( *pxResult == errQUEUE_BLOCKED ) 												\
	{																					\
		crSET_STATE0( xHandle );														\
		*pxResult = xQueueCRReceive( pxQueue, pvBuffer, 0 );							\
	}																					\
	if( *pxResult == errQUEUE_YIELD )													\
	{																					\
		crSET_STATE1( xHandle );														\
		*pxResult = pdPASS;																\
	}																					\
}

/**
 * croutine. h
 * <pre>
  crQUEUE_SEND_FROM_ISR(
                            xQueueHandle pxQueue,
                            void *pvItemToQueue,
                            portBASE_TYPE xCoRoutinePreviouslyWoken
                       )</pre>
 *
 * The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the
 * co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR()
 * functions used by tasks.
 *
 * crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() can only be used to
 * pass data between a co-routine and and ISR, whereas xQueueSendFromISR() and
 * xQueueReceiveFromISR() can only be used to pass data between a task and and
 * ISR.
 *
 * crQUEUE_SEND_FROM_ISR can only be called from an ISR to send data to a queue
 * that is being used from within a co-routine.
 *
 * See the co-routine section of the WEB documentation for information on
 * passing data between tasks and co-routines and between ISR's and
 * co-routines.
 *
 * @param xQueue The handle to the queue on which the item is to be posted.
 *
 * @param pvItemToQueue A pointer to the item that is to be placed on the
 * queue.  The size of the items the queue will hold was defined when the
 * queue was created, so this many bytes will be copied from pvItemToQueue
 * into the queue storage area.
 *
 * @param xCoRoutinePreviouslyWoken This is included so an ISR can post onto
 * the same queue multiple times from a single interrupt.  The first call
 * should always pass in pdFALSE.  Subsequent calls should pass in
 * the value returned from the previous call.
 *
 * @return pdTRUE if a co-routine was woken by posting onto the queue.  This is
 * used by the ISR to determine if a context switch may be required following
 * the ISR.
 *
 * Example usage:
 <pre>
 // A co-routine that blocks on a queue waiting for characters to be received.
 static void vReceivingCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
 {
 char cRxedChar;
 portBASE_TYPE xResult;

     // All co-routines must start with a call to crSTART().
     crSTART( xHandle );

     for( ;; )
     {
         // Wait for data to become available on the queue.  This assumes the
         // queue xCommsRxQueue has already been created!
         crQUEUE_RECEIVE( xHandle, xCommsRxQueue, &uxLEDToFlash, portMAX_DELAY, &xResult );

         // Was a character received?
         if( xResult == pdPASS )
         {
             // Process the character here.
         }
     }

     // All co-routines must end with a call to crEND().
     crEND();
 }

 // An ISR that uses a queue to send characters received on a serial port to
 // a co-routine.
 void vUART_ISR( void )
 {
 char cRxedChar;
 portBASE_TYPE xCRWokenByPost = pdFALSE;

     // We loop around reading characters until there are none left in the UART.
     while( UART_RX_REG_NOT_EMPTY() )
     {
         // Obtain the character from the UART.
         cRxedChar = UART_RX_REG;

         // Post the character onto a queue.  xCRWokenByPost will be pdFALSE
         // the first time around the loop.  If the post causes a co-routine
         // to be woken (unblocked) then xCRWokenByPost will be set to pdTRUE.
         // In this manner we can ensure that if more than one co-routine is
         // blocked on the queue only one is woken by this ISR no matter how
         // many characters are posted to the queue.
         xCRWokenByPost = crQUEUE_SEND_FROM_ISR( xCommsRxQueue, &cRxedChar, xCRWokenByPost );
     }
 }</pre>
 * \defgroup crQUEUE_SEND_FROM_ISR crQUEUE_SEND_FROM_ISR
 * \ingroup Tasks
 */
#define crQUEUE_SEND_FROM_ISR( pxQueue, pvItemToQueue, xCoRoutinePreviouslyWoken ) xQueueCRSendFromISR( pxQueue, pvItemToQueue, xCoRoutinePreviouslyWoken )


/**
 * croutine. h
 * <pre>
  crQUEUE_SEND_FROM_ISR(
                            xQueueHandle pxQueue,
                            void *pvBuffer,
                            portBASE_TYPE * pxCoRoutineWoken
                       )</pre>
 *
 * The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the
 * co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR()
 * functions used by tasks.
 *
 * crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() can only be used to
 * pass data between a co-routine and and ISR, whereas xQueueSendFromISR() and
 * xQueueReceiveFromISR() can only be used to pass data between a task and and
 * ISR.
 *
 * crQUEUE_RECEIVE_FROM_ISR can only be called from an ISR to receive data
 * from a queue that is being used from within a co-routine (a co-routine
 * posted to the queue).
 *
 * See the co-routine section of the WEB documentation for information on
 * passing data between tasks and co-routines and between ISR's and
 * co-routines.
 *
 * @param xQueue The handle to the queue on which the item is to be posted.
 *
 * @param pvBuffer A pointer to a buffer into which the received item will be
 * placed.  The size of the items the queue will hold was defined when the
 * queue was created, so this many bytes will be copied from the queue into
 * pvBuffer.
 *
 * @param pxCoRoutineWoken A co-routine may be blocked waiting for space to become
 * available on the queue.  If crQUEUE_RECEIVE_FROM_ISR causes such a
 * co-routine to unblock *pxCoRoutineWoken will get set to pdTRUE, otherwise
 * *pxCoRoutineWoken will remain unchanged.
 *
 * @return pdTRUE an item was successfully received from the queue, otherwise
 * pdFALSE.
 *
 * Example usage:
 <pre>
 // A co-routine that posts a character to a queue then blocks for a fixed
 // period.  The character is incremented each time.
 static void vSendingCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
 {
 // cChar holds its value while this co-routine is blocked and must therefore
 // be declared static.
 static char cCharToTx = 'a';
 portBASE_TYPE xResult;

     // All co-routines must start with a call to crSTART().
     crSTART( xHandle );

     for( ;; )
     {
         // Send the next character to the queue.
         crQUEUE_SEND( xHandle, xCoRoutineQueue, &cCharToTx, NO_DELAY, &xResult );

         if( xResult == pdPASS )
         {
             // The character was successfully posted to the queue.
         }
		 else
		 {
			// Could not post the character to the queue.
		 }

         // Enable the UART Tx interrupt to cause an interrupt in this
		 // hypothetical UART.  The interrupt will obtain the character
		 // from the queue and send it.
		 ENABLE_RX_INTERRUPT();

		 // Increment to the next character then block for a fixed period.
		 // cCharToTx will maintain its value across the delay as it is
		 // declared static.
		 cCharToTx++;
		 if( cCharToTx > 'x' )
		 {
			cCharToTx = 'a';
		 }
		 crDELAY( 100 );
     }

     // All co-routines must end with a call to crEND().
     crEND();
 }

 // An ISR that uses a queue to receive characters to send on a UART.
 void vUART_ISR( void )
 {
 char cCharToTx;
 portBASE_TYPE xCRWokenByPost = pdFALSE;

     while( UART_TX_REG_EMPTY() )
     {
         // Are there any characters in the queue waiting to be sent?
		 // xCRWokenByPost will automatically be set to pdTRUE if a co-routine
		 // is woken by the post - ensuring that only a single co-routine is
		 // woken no matter how many times we go around this loop.
         if( crQUEUE_RECEIVE_FROM_ISR( pxQueue, &cCharToTx, &xCRWokenByPost ) )
		 {
			 SEND_CHARACTER( cCharToTx );
		 }
     }
 }</pre>
 * \defgroup crQUEUE_RECEIVE_FROM_ISR crQUEUE_RECEIVE_FROM_ISR
 * \ingroup Tasks
 */
#define crQUEUE_RECEIVE_FROM_ISR( pxQueue, pvBuffer, pxCoRoutineWoken ) xQueueCRReceiveFromISR( pxQueue, pvBuffer, pxCoRoutineWoken )

/*
 * This function is intended for internal use by the co-routine macros only.
 * The macro nature of the co-routine implementation requires that the
 * prototype appears here.  The function should not be used by application
 * writers.
 *
 * Removes the current co-routine from its ready list and places it in the
 * appropriate delayed list.
 */
void vCoRoutineAddToDelayedList( portTickType xTicksToDelay, xList *pxEventList );

/*
 * This function is intended for internal use by the queue implementation only.
 * The function should not be used by application writers.
 *
 * Removes the highest priority co-routine from the event list and places it in
 * the pending ready list.
 */
signed portBASE_TYPE xCoRoutineRemoveFromEventList( const xList *pxEventList );

#ifdef __cplusplus
}
#endif

#endif /* CO_ROUTINE_H */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人精品在线视频观看| 亚洲成av人影院| 欧美白人最猛性xxxxx69交| 欧美日韩亚州综合| 欧美色图激情小说| 欧美一区二区三区日韩视频| 8v天堂国产在线一区二区| 欧美日韩一区二区三区免费看 | 亚洲欧美另类图片小说| 成人免费一区二区三区在线观看| 亚洲欧洲在线观看av| 一区二区三区蜜桃网| 亚洲地区一二三色| 丝袜美腿亚洲一区二区图片| 亚洲大片一区二区三区| 蜜臀av性久久久久蜜臀aⅴ流畅 | 曰韩精品一区二区| 亚洲一卡二卡三卡四卡五卡| 免费在线成人网| 国内精品久久久久影院薰衣草| 久久国产生活片100| 成人性色生活片免费看爆迷你毛片| 成人久久18免费网站麻豆| 91麻豆福利精品推荐| 911精品产国品一二三产区| 久久黄色级2电影| 国产精品免费人成网站| 亚洲乱码国产乱码精品精98午夜 | 欧美日韩国产三级| 精品电影一区二区| 亚洲天堂成人在线观看| 亚洲aⅴ怡春院| 风间由美性色一区二区三区| 色综合色狠狠综合色| 日韩一级片网站| 国产精品电影一区二区三区| 日av在线不卡| 91香蕉视频在线| 精品久久国产字幕高潮| 最新国产精品久久精品| 日本aⅴ精品一区二区三区| av亚洲精华国产精华精华| 欧美老年两性高潮| 欧美激情在线一区二区三区| 亚洲大片在线观看| 不卡的av中国片| 欧美mv和日韩mv国产网站| 亚洲女人****多毛耸耸8| 国产伦理精品不卡| 欧美日韩国产首页| 亚洲综合一区二区三区| 成人性生交大片免费看在线播放| 在线播放欧美女士性生活| 中文字幕一区三区| 国产一区二区视频在线播放| 欧美电影影音先锋| 亚洲图片另类小说| 国产成人综合网站| 日韩久久久精品| 日韩一区精品视频| 欧美性一区二区| 亚洲欧美日韩综合aⅴ视频| 国产传媒日韩欧美成人| 精品国产sm最大网站| 免费观看一级特黄欧美大片| 欧美巨大另类极品videosbest| 中文字幕在线视频一区| 精品一区二区在线视频| 欧美一级国产精品| 香港成人在线视频| 欧美人伦禁忌dvd放荡欲情| 最新国产成人在线观看| 99久久国产免费看| 亚洲免费观看视频| 91精品办公室少妇高潮对白| 亚洲国产一区二区在线播放| 99久精品国产| 亚洲三级理论片| 欧美自拍丝袜亚洲| 亚洲国产日产av| 欧美日韩亚洲综合| 日本一不卡视频| 日韩精品一区二| 韩国毛片一区二区三区| 久久精品一级爱片| 波多野结衣在线一区| 中文字幕一区二区三中文字幕| www.成人网.com| 一区二区不卡在线播放| 69av一区二区三区| 国产麻豆一精品一av一免费| 久久精品视频一区二区三区| www.亚洲人| 午夜精品久久久久久久蜜桃app| 欧美日韩一区二区在线视频| 久久99久久99| 国产精品毛片久久久久久| 91小视频在线| 老色鬼精品视频在线观看播放| www成人在线观看| 91一区一区三区| 视频在线观看一区二区三区| 久久久久国产精品麻豆| 色诱视频网站一区| 麻豆视频观看网址久久| 中文字幕一区二区三区色视频 | 国产成人午夜电影网| 亚洲欧美在线aaa| 3d成人h动漫网站入口| 国内成人自拍视频| 一区二区三区四区av| 欧美不卡一区二区三区四区| 91伊人久久大香线蕉| 久久精品国产精品亚洲红杏| 亚洲日本在线观看| 欧美电影免费观看高清完整版| 99国产精品久久久久久久久久| 日韩av中文在线观看| 国产精品久久久久久久午夜片 | 欧美精品丝袜中出| 福利一区二区在线观看| 午夜婷婷国产麻豆精品| 日韩一区日韩二区| 精品国产乱码久久久久久蜜臀| 91精彩视频在线观看| 国产精品系列在线观看| 亚洲成人自拍网| 国产精品久久三| 久久网这里都是精品| 在线播放日韩导航| 欧美在线播放高清精品| 成人午夜视频在线| 狠狠色综合播放一区二区| 亚洲小少妇裸体bbw| 亚洲丝袜精品丝袜在线| 久久精品夜色噜噜亚洲aⅴ| 日韩视频中午一区| 欧美精品免费视频| 欧美性大战久久| 欧美亚洲综合网| 91蝌蚪porny| av在线不卡电影| 成人av在线资源网| 成人黄动漫网站免费app| 国产一区二区不卡在线| 国产成人精品免费看| 国产在线乱码一区二区三区| 蜜桃视频免费观看一区| 午夜电影久久久| 亚洲高清免费一级二级三级| 亚洲精品第一国产综合野| 亚洲欧洲国产日韩| 亚洲精品视频免费看| 国产精品网站在线播放| 国产精品福利一区二区三区| 亚洲私人黄色宅男| 亚洲欧美经典视频| 玉足女爽爽91| 香蕉成人伊视频在线观看| 日本特黄久久久高潮| 麻豆视频一区二区| 国产一区高清在线| 大胆欧美人体老妇| av网站一区二区三区| 99久久夜色精品国产网站| 色婷婷综合视频在线观看| 欧美性大战xxxxx久久久| 7777精品伊人久久久大香线蕉最新版 | 亚洲国产成人av网| 丝袜美腿亚洲色图| 国内精品久久久久影院色| 成人免费av在线| 在线免费观看成人短视频| 91激情五月电影| 欧美精品1区2区| 久久久久久久久久看片| 国产精品国产三级国产普通话99 | 亚洲欧美日韩国产另类专区| 一区二区高清在线| 麻豆免费看一区二区三区| 成人ar影院免费观看视频| 欧美性受xxxx| 久久亚洲一级片| 一区二区三区在线播放| 美国毛片一区二区三区| av午夜精品一区二区三区| 欧美高清激情brazzers| 久久女同精品一区二区| 一区二区三区日韩精品| 久久精品国内一区二区三区| 99精品一区二区| 亚洲精品在线电影| 一级日本不卡的影视| 国产精品亚洲成人| 欧美精品一二三| 专区另类欧美日韩| 久久99久久久欧美国产| 欧洲国内综合视频| 久久日韩精品一区二区五区| 五月综合激情日本mⅴ|