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

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

?? croutine.h

?? 一個開源的Modbus協議棧
?? H
?? 第 1 頁 / 共 2 頁
字號:
/*

	FreeRTOS.org V4.1.1 - Copyright (C) 2003-2006 Richard Barry.



	This file is part of the FreeRTOS.org distribution.



	FreeRTOS.org is free software; you can redistribute it and/or modify

	it under the terms of the GNU General Public License as published by

	the Free Software Foundation; either version 2 of the License, or

	(at your option) any later version.



	FreeRTOS.org is distributed in the hope that it will be useful,

	but WITHOUT ANY WARRANTY; without even the implied warranty of

	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

	GNU General Public License for more details.



	You should have received a copy of the GNU General Public License

	along with FreeRTOS.org; if not, write to the Free Software

	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA



	A special exception to the GPL can be applied should you wish to distribute

	a combined work that includes FreeRTOS.org, without being obliged to provide

	the source code for any proprietary components.  See the licensing section

	of http://www.FreeRTOS.org for full details of how and when the exception

	can be applied.



	***************************************************************************

	See http://www.FreeRTOS.org for documentation, latest information, license

	and contact details.  Please ensure to read the configuration and relevant

	port sections of the online documentation.

	***************************************************************************

*/

#ifndef CO_ROUTINE_H

#define CO_ROUTINE_H



#include "list.h"



/* Used to hide the implementation of the co-routine control block.  The

control block structure however has to be included in the header due to

the macro implementation of the co-routine functionality. */

typedef void * xCoRoutineHandle;



/* Defines the prototype to which co-routine functions must conform. */

typedef void (*crCOROUTINE_CODE)( xCoRoutineHandle, unsigned portBASE_TYPE );



typedef struct corCoRoutineControlBlock

{

	crCOROUTINE_CODE 		pxCoRoutineFunction;

	xListItem				xGenericListItem;	/*< List item used to place the CRCB in ready and blocked queues. */

	xListItem				xEventListItem;		/*< List item used to place the CRCB in event lists. */

	unsigned portBASE_TYPE 	uxPriority;			/*< The priority of the co-routine in relation to other co-routines. */

	unsigned portBASE_TYPE 	uxIndex;			/*< Used to distinguish between co-routines when multiple co-routines use the same co-routine function. */

	unsigned portSHORT 		uxState;			/*< Used internally by the co-routine implementation. */

} corCRCB; /* Co-routine control block.  Note must be identical in size down to uxPriority with tskTCB. */



/**

 * croutine. h

 *<pre>

 portBASE_TYPE xCoRoutineCreate(

                                 crCOROUTINE_CODE pxCoRoutineCode,

                                 unsigned portBASE_TYPE uxPriority,

                                 unsigned portBASE_TYPE uxIndex

                               );</pre>

 *

 * Create a new co-routine and add it to the list of co-routines that are

 * ready to run.

 *

 * @param pxCoRoutineCode Pointer to the co-routine function.  Co-routine

 * functions require special syntax - see the co-routine section of the WEB

 * documentation for more information.

 *

 * @param uxPriority The priority with respect to other co-routines at which

 *  the co-routine will run.

 *

 * @param uxIndex Used to distinguish between different co-routines that

 * execute the same function.  See the example below and the co-routine section

 * of the WEB documentation for further information.

 *

 * @return pdPASS if the co-routine was successfully created and added to a ready

 * list, otherwise an error code defined with ProjDefs.h.

 *

 * Example usage:

   <pre>

 // Co-routine to be created.

 void vFlashCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )

 {

 // Variables in co-routines must be declared static if they must maintain value across a blocking call.

 // This may not be necessary for const variables.

 static const char cLedToFlash[ 2 ] = { 5, 6 };

 static const portTickType xTimeToDelay[ 2 ] = { 200, 400 };



     // Must start every co-routine with a call to crSTART();

     crSTART( xHandle );



     for( ;; )

     {

         // This co-routine just delays for a fixed period, then toggles

         // an LED.  Two co-routines are created using this function, so

         // the uxIndex parameter is used to tell the co-routine which

         // LED to flash and how long to delay.  This assumes xQueue has

         // already been created.

         vParTestToggleLED( cLedToFlash[ uxIndex ] );

         crDELAY( xHandle, uxFlashRates[ uxIndex ] );

     }



     // Must end every co-routine with a call to crEND();

     crEND();

 }



 // Function that creates two co-routines.

 void vOtherFunction( void )

 {

 unsigned char ucParameterToPass;

 xTaskHandle xHandle;

		

     // Create two co-routines at priority 0.  The first is given index 0

     // so (from the code above) toggles LED 5 every 200 ticks.  The second

     // is given index 1 so toggles LED 6 every 400 ticks.

     for( uxIndex = 0; uxIndex < 2; uxIndex++ )

     {

         xCoRoutineCreate( vFlashCoRoutine, 0, uxIndex );

     }

 }

   </pre>

 * \defgroup xCoRoutineCreate xCoRoutineCreate

 * \ingroup Tasks

 */

signed portBASE_TYPE xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode, unsigned portBASE_TYPE uxPriority, unsigned portBASE_TYPE uxIndex );





/**

 * croutine. h

 *<pre>

 void vCoRoutineSchedule( void );</pre>

 *

 * Run a co-routine.

 *

 * vCoRoutineSchedule() executes the highest priority co-routine that is able

 * to run.  The co-routine will execute until it either blocks, yields or is

 * preempted by a task.  Co-routines execute cooperatively so one

 * co-routine cannot be preempted by another, but can be preempted by a task.

 *

 * If an application comprises of both tasks and co-routines then

 * vCoRoutineSchedule should be called from the idle task (in an idle task

 * hook).

 *

 * Example usage:

   <pre>

 // This idle task hook will schedule a co-routine each time it is called.

 // The rest of the idle task will execute between co-routine calls.

 void vApplicationIdleHook( void )

 {

	vCoRoutineSchedule();

 }



 // Alternatively, if you do not require any other part of the idle task to

 // execute, the idle task hook can call vCoRoutineScheduler() within an

 // infinite loop.

 void vApplicationIdleHook( void )

 {

    for( ;; )

    {

        vCoRoutineSchedule();

    }

 }

 </pre>

 * \defgroup vCoRoutineSchedule vCoRoutineSchedule

 * \ingroup Tasks

 */

void vCoRoutineSchedule( void );



/**

 * croutine. h

 * <pre>

 crSTART( xCoRoutineHandle xHandle );</pre>

 *

 * This macro MUST always be called at the start of a co-routine function.

 *

 * Example usage:

   <pre>

 // Co-routine to be created.

 void vACoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )

 {

 // Variables in co-routines must be declared static if they must maintain value across a blocking call.

 static portLONG ulAVariable;



     // Must start every co-routine with a call to crSTART();

     crSTART( xHandle );



     for( ;; )

     {

          // Co-routine functionality goes here.

     }



     // Must end every co-routine with a call to crEND();

     crEND();

 }</pre>

 * \defgroup crSTART crSTART

 * \ingroup Tasks

 */

#define crSTART( pxCRCB ) switch( ( ( corCRCB * )pxCRCB )->uxState ) { case 0:



/**

 * croutine. h

 * <pre>

 crEND();</pre>

 *

 * This macro MUST always be called at the end of a co-routine function.

 *

 * Example usage:

   <pre>

 // Co-routine to be created.

 void vACoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )

 {

 // Variables in co-routines must be declared static if they must maintain value across a blocking call.

 static portLONG ulAVariable;



     // Must start every co-routine with a call to crSTART();

     crSTART( xHandle );



     for( ;; )

     {

          // Co-routine functionality goes here.

     }



     // Must end every co-routine with a call to crEND();

     crEND();

 }</pre>

 * \defgroup crSTART crSTART

 * \ingroup Tasks

 */

#define crEND() }



/*

 * These macros are intended for internal use by the co-routine implementation

 * only.  The macros should not be used directly by application writers.

 */

#define crSET_STATE0( xHandle ) ( ( corCRCB * )xHandle)->uxState = (__LINE__ * 2); return; case (__LINE__ * 2):

#define crSET_STATE1( xHandle ) ( ( corCRCB * )xHandle)->uxState = ((__LINE__ * 2)+1); return; case ((__LINE__ * 2)+1):



/**

 * croutine. h

 *<pre>

 crDELAY( xCoRoutineHandle xHandle, portTickType xTicksToDelay );</pre>

 *

 * Delay a co-routine for a fixed period of time.

 *

 * crDELAY 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.

 *

 * @param xHandle The handle of the co-routine to delay.  This is the xHandle

 * parameter of the co-routine function.

 *

 * @param xTickToDelay The number of ticks that the co-routine should delay

 * for.  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.

 *

 * Example usage:

   <pre>

 // Co-routine to be created.

 void vACoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )

 {

 // Variables in co-routines must be declared static if they must maintain value across a blocking call.

 // This may not be necessary for const variables.

 // We are to delay for 200ms.

 static const xTickType xDelayTime = 200 / portTICK_RATE_MS;



     // Must start every co-routine with a call to crSTART();

     crSTART( xHandle );



     for( ;; )

     {

        // Delay for 200ms.

        crDELAY( xHandle, xDelayTime );



        // Do something here.

     }



     // Must end every co-routine with a call to crEND();

     crEND();

 }</pre>

 * \defgroup crDELAY crDELAY

 * \ingroup Tasks

 */

#define crDELAY( xHandle, xTicksToDelay )												\

	if( xTicksToDelay > 0 )																\

	{																					\

		vCoRoutineAddToDelayedList( xTicksToDelay, NULL );								\

	}																					\

	crSET_STATE0( xHandle );



/**

 * <pre>

 crQUEUE_SEND(

                  xCoRoutineHandle xHandle,

                  xQueueHandle pxQueue,

                  void *pvItemToQueue,

                  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_SEND 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 on which the data will be posted.

 * The handle is obtained as the return value when the queue is created using

 * the xQueueCreate() API function.

 *

 * @param pvItemToQueue A pointer to the data being posted onto the queue.

 * The number of bytes of each queued item is specified when the queue is

 * created.  This number of bytes is copied from pvItemToQueue into the queue

 * itself.

 *

 * @param xTickToDelay The number of ticks that the co-routine should block

 * to wait for space to become available on the queue, should space 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 example

 * below).

 *

 * @param pxResult The variable pointed to by pxResult will be set to pdPASS if

 * data was successfully posted onto the queue, otherwise it will be set to an

 * error defined within ProjDefs.h.

 *

 * Example usage:

   <pre>

 // Co-routine function that blocks for a fixed period then posts a number onto

 // 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 );



?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线播放视频一区| 国产精品免费免费| 最近日韩中文字幕| 免费xxxx性欧美18vr| 99久久精品费精品国产一区二区| 91麻豆精品国产91久久久使用方法 | 欧美成人国产一区二区| 国产精品久久久久久久久晋中 | 美女国产一区二区三区| 色婷婷亚洲综合| 中文字幕第一页久久| 精品午夜久久福利影院| 欧美日本一道本| 一区二区三区在线看| 成人av综合一区| 国产日产亚洲精品系列| 青青草成人在线观看| 91国产视频在线观看| 国产日韩精品一区| 国产一区二区0| 欧美精品一二三四| 综合亚洲深深色噜噜狠狠网站| 国产中文字幕一区| 欧美大片日本大片免费观看| 日韩精彩视频在线观看| 欧美日韩精品专区| 亚洲国产欧美日韩另类综合| 成人av在线一区二区| 中文字幕+乱码+中文字幕一区| 国产一区二区调教| 亚洲精品一区二区三区香蕉 | 欧洲人成人精品| 一区二区三区在线免费观看| 日本电影欧美片| 亚洲乱码国产乱码精品精98午夜| av欧美精品.com| 亚洲视频你懂的| 色老汉一区二区三区| 亚洲综合激情网| 欧美亚洲国产一区二区三区va| 免费在线视频一区| 欧美日韩电影在线| 美女视频一区二区| 久久伊人中文字幕| 国产高清在线精品| 欧美激情综合五月色丁香| 成人免费福利片| 亚洲激情五月婷婷| 欧美日韩mp4| 激情丁香综合五月| 国产精品第13页| 欧亚一区二区三区| 久久精品国产色蜜蜜麻豆| 国产午夜精品一区二区三区视频 | 精品一区二区三区视频在线观看| 久久蜜桃av一区精品变态类天堂 | 久久91精品国产91久久小草 | 欧美videos大乳护士334| 精品综合免费视频观看| 中文字幕精品综合| 欧美日韩极品在线观看一区| 久久er99精品| 亚洲三级在线观看| 欧美一级xxx| 波波电影院一区二区三区| 亚洲国产成人av网| 久久精品视频网| 欧美亚一区二区| 国产一区二区电影| 亚洲成av人片在线| 国产欧美精品国产国产专区| 91精品办公室少妇高潮对白| 精品在线观看视频| ●精品国产综合乱码久久久久| 91福利在线观看| 国产一区二区三区在线观看精品| 亚洲乱码日产精品bd| 久久日韩精品一区二区五区| 欧洲精品一区二区| 国产福利一区二区| 日韩1区2区3区| 亚洲人成网站精品片在线观看| 日韩免费视频线观看| 在线亚洲一区二区| 国产aⅴ综合色| 琪琪久久久久日韩精品| 亚洲日本一区二区| 亚洲精品一区二区三区在线观看| 欧美性色黄大片| 96av麻豆蜜桃一区二区| 紧缚奴在线一区二区三区| 亚洲二区视频在线| 亚洲精品精品亚洲| 国产精品久线在线观看| 日韩免费一区二区三区在线播放| 欧美午夜理伦三级在线观看| av成人免费在线观看| 国产一区二区三区在线观看精品 | 99久久精品免费看国产| 国产一区二区三区日韩| 爽爽淫人综合网网站| 国产美女视频91| 日韩精品91亚洲二区在线观看| 艳妇臀荡乳欲伦亚洲一区| 国产精品少妇自拍| 久久精子c满五个校花| 欧美v日韩v国产v| 日韩精品专区在线影院重磅| 69成人精品免费视频| 在线观看不卡一区| 成人久久18免费网站麻豆| 国产一区二区三区在线观看免费 | 亚洲成国产人片在线观看| 亚洲蜜臀av乱码久久精品| 成人欧美一区二区三区视频网页| 中文字幕av一区二区三区免费看| 久久久99久久| 国产欧美日韩在线观看| 国产欧美日韩综合| 国产精品福利av| 一区二区三区中文字幕| 亚洲午夜精品一区二区三区他趣| 亚洲一区二区三区四区的| 亚洲国产综合在线| 日韩综合一区二区| 美女免费视频一区| 国产成人精品影视| 99精品桃花视频在线观看| 色偷偷一区二区三区| 欧美日韩的一区二区| 日韩一区二区在线看片| 精品不卡在线视频| 国产精品天干天干在线综合| 亚洲欧洲一区二区在线播放| 亚洲一区二区视频在线观看| 日韩av在线播放中文字幕| 国内精品久久久久影院一蜜桃| 国产成人av电影在线观看| 91在线云播放| 欧美高清视频在线高清观看mv色露露十八 | 欧美电影精品一区二区| 精品久久久久久久久久久久包黑料| 久久一区二区三区国产精品| 国产欧美日本一区二区三区| 亚洲综合色网站| 九九在线精品视频| 91一区二区在线| 777午夜精品视频在线播放| 久久网站最新地址| 亚洲一区二区在线播放相泽| 精品午夜一区二区三区在线观看| 高清成人免费视频| 欧美久久一区二区| 欧美国产激情一区二区三区蜜月| 亚洲成人激情社区| 欧美乱妇15p| 国产精品人妖ts系列视频| 日韩一区二区三区免费看 | 国产精品一线二线三线| 成人aa视频在线观看| 欧美电影在线免费观看| 国产精品视频九色porn| 看片网站欧美日韩| 色综合久久99| 久久精品视频免费观看| 五月激情综合网| 91女厕偷拍女厕偷拍高清| 久久久久99精品一区| 亚洲福中文字幕伊人影院| 99久久国产综合精品女不卡| 日韩一区二区视频| 一区二区三区波多野结衣在线观看 | 粉嫩av亚洲一区二区图片| 欧美精品18+| 亚洲高清不卡在线| 一本在线高清不卡dvd| 国产清纯在线一区二区www| 三级亚洲高清视频| 在线精品视频一区二区三四| 国产精品理论片在线观看| 国产中文一区二区三区| 日韩欧美国产一二三区| 亚洲黄色在线视频| 99久久久无码国产精品| 久久九九国产精品| 韩国理伦片一区二区三区在线播放| 欧美精品精品一区| www激情久久| 26uuu亚洲| 奇米精品一区二区三区四区| 精品视频在线看| 亚洲精品高清在线| 91在线免费播放| 中文字幕欧美一区| 色婷婷一区二区三区四区| 亚洲人123区| 在线亚洲免费视频| 亚洲国产一区二区在线播放| 色88888久久久久久影院按摩| 亚洲色图一区二区三区|