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

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

?? crflash.c

?? 最新版FreeRTOS, 包擴多種開發平臺的移植
?? C
字號:
/*
	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.
	***************************************************************************
*/

/*
 * This demo application file demonstrates the use of queues to pass data
 * between co-routines.
 *
 * N represents the number of 'fixed delay' co-routines that are created and
 * is set during initialisation.
 *
 * N 'fixed delay' co-routines are created that just block for a fixed
 * period then post the number of an LED onto a queue.  Each such co-routine
 * uses a different block period.  A single 'flash' co-routine is also created
 * that blocks on the same queue, waiting for the number of the next LED it
 * should flash.  Upon receiving a number it simply toggle the instructed LED
 * then blocks on the queue once more.  In this manner each LED from LED 0 to
 * LED N-1 is caused to flash at a different rate.
 *
 * The 'fixed delay' co-routines are created with co-routine priority 0.  The
 * flash co-routine is created with co-routine priority 1.  This means that
 * the queue should never contain more than a single item.  This is because
 * posting to the queue will unblock the 'flash' co-routine, and as this has
 * a priority greater than the tasks posting to the queue it is guaranteed to
 * have emptied the queue and blocked once again before the queue can contain
 * any more date.  An error is indicated if an attempt to post data to the
 * queue fails - indicating that the queue is already full.
 *
 */

/* Scheduler includes. */
#include "FreeRTOS.h"
#include "croutine.h"
#include "queue.h"

/* Demo application includes. */
#include "partest.h"
#include "crflash.h"

/* The queue should only need to be of length 1.  See the description at the
top of the file. */
#define crfQUEUE_LENGTH		1

#define crfFIXED_DELAY_PRIORITY		0
#define crfFLASH_PRIORITY			1

/* Only one flash co-routine is created so the index is not significant. */
#define crfFLASH_INDEX				0

/* Don't allow more than crfMAX_FLASH_TASKS 'fixed delay' co-routines to be
created. */
#define crfMAX_FLASH_TASKS			8

/* We don't want to block when posting to the queue. */
#define crfPOSTING_BLOCK_TIME		0

/*
 * The 'fixed delay' co-routine as described at the top of the file.
 */
static void prvFixedDelayCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex );

/*
 * The 'flash' co-routine as described at the top of the file.
 */
static void prvFlashCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex );

/* The queue used to pass data between the 'fixed delay' co-routines and the
'flash' co-routine. */
static xQueueHandle xFlashQueue;

/* This will be set to pdFALSE if we detect an error. */
static unsigned portBASE_TYPE uxCoRoutineFlashStatus = pdPASS;

/*-----------------------------------------------------------*/

/*
 * See the header file for details.
 */
void vStartFlashCoRoutines( unsigned portBASE_TYPE uxNumberToCreate )
{
unsigned portBASE_TYPE uxIndex;

	if( uxNumberToCreate > crfMAX_FLASH_TASKS )
	{
		uxNumberToCreate = crfMAX_FLASH_TASKS;
	}

	/* Create the queue used to pass data between the co-routines. */
	xFlashQueue = xQueueCreate( crfQUEUE_LENGTH, sizeof( unsigned portBASE_TYPE ) );

	if( xFlashQueue )
	{
		/* Create uxNumberToCreate 'fixed delay' co-routines. */
		for( uxIndex = 0; uxIndex < uxNumberToCreate; uxIndex++ )
		{
			xCoRoutineCreate( prvFixedDelayCoRoutine, crfFIXED_DELAY_PRIORITY, uxIndex );
		}

		/* Create the 'flash' co-routine. */
		xCoRoutineCreate( prvFlashCoRoutine, crfFLASH_PRIORITY, crfFLASH_INDEX );
	}
}
/*-----------------------------------------------------------*/

static void prvFixedDelayCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
{
/* Even though this is a co-routine the xResult variable does not need to be
static as we do not need it to maintain its state between blocks. */
signed portBASE_TYPE xResult;
/* The uxIndex parameter of the co-routine function is used as an index into
the xFlashRates array to obtain the delay period to use. */
static const portTickType xFlashRates[ crfMAX_FLASH_TASKS ] = { 150 / portTICK_RATE_MS,
																200 / portTICK_RATE_MS,
																250 / portTICK_RATE_MS,
																300 / portTICK_RATE_MS,
																350 / portTICK_RATE_MS,
																400 / portTICK_RATE_MS,
																450 / portTICK_RATE_MS,
																500  / portTICK_RATE_MS };

	/* Co-routines MUST start with a call to crSTART. */
	crSTART( xHandle );

	for( ;; )
	{
		/* Post our uxIndex value onto the queue.  This is used as the LED to
		flash. */
		crQUEUE_SEND( xHandle, xFlashQueue, ( void * ) &uxIndex, crfPOSTING_BLOCK_TIME, &xResult );

		if( xResult != pdPASS )
		{
			/* For the reasons stated at the top of the file we should always
			find that we can post to the queue.  If we could not then an error
			has occurred. */
			uxCoRoutineFlashStatus = pdFAIL;
		}

		crDELAY( xHandle, xFlashRates[ uxIndex ] );
	}

	/* Co-routines MUST end with a call to crEND. */
	crEND();
}
/*-----------------------------------------------------------*/

static void prvFlashCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )
{
/* Even though this is a co-routine the variable do not need to be
static as we do not need it to maintain their state between blocks. */
signed portBASE_TYPE xResult;
unsigned portBASE_TYPE uxLEDToFlash;

	/* Co-routines MUST start with a call to crSTART. */
	crSTART( xHandle );
	( void ) uxIndex;
	
	for( ;; )
	{
		/* Block to wait for the number of the LED to flash. */
		crQUEUE_RECEIVE( xHandle, xFlashQueue, &uxLEDToFlash, portMAX_DELAY, &xResult );		

		if( xResult != pdPASS )
		{
			/* We would not expect to wake unless we received something. */
			uxCoRoutineFlashStatus = pdFAIL;
		}
		else
		{
			/* We received the number of an LED to flash - flash it! */
			vParTestToggleLED( uxLEDToFlash );
		}
	}

	/* Co-routines MUST end with a call to crEND. */
	crEND();
}
/*-----------------------------------------------------------*/

portBASE_TYPE xAreFlashCoRoutinesStillRunning( void )
{
	/* Return pdPASS or pdFAIL depending on whether an error has been detected
	or not. */
	return uxCoRoutineFlashStatus;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产精品久久久久秋霞影院| 久久这里都是精品| 国产成a人无v码亚洲福利| 日韩电影免费在线观看网站| 一区二区三区精品视频| 中文字幕一区av| 亚洲欧洲www| 中文字幕制服丝袜一区二区三区| 日本一区二区三区在线不卡| 国产亚洲美州欧州综合国| 精品国产乱码久久久久久夜甘婷婷 | 亚洲美女免费在线| 亚洲日穴在线视频| 夜夜夜精品看看| 首页欧美精品中文字幕| 日韩中文字幕麻豆| 久久草av在线| 精品一区二区三区蜜桃| 国产精品1区2区| 91免费看片在线观看| 欧美在线三级电影| 欧美一级一区二区| 亚洲精品一区二区三区精华液 | 91精品蜜臀在线一区尤物| 日韩欧美在线影院| 久久久精品2019中文字幕之3| 国产欧美综合色| 亚洲人午夜精品天堂一二香蕉| 亚洲专区一二三| 免费黄网站欧美| 97久久精品人人做人人爽 | 久久超碰97人人做人人爱| 成人h动漫精品| 欧美日韩色一区| 欧美经典一区二区| 亚洲激情一二三区| 日本系列欧美系列| 亚洲同性gay激情无套| 日本不卡视频一二三区| 国内外成人在线视频| 成人久久久精品乱码一区二区三区| 粗大黑人巨茎大战欧美成人| 成人小视频在线观看| 欧美综合在线视频| 欧美成va人片在线观看| 欧美激情一二三区| 亚洲h精品动漫在线观看| 久久国产日韩欧美精品| 激情综合网天天干| 在线一区二区视频| 久久夜色精品国产噜噜av | 91美女片黄在线| 欧美日韩第一区日日骚| 欧美变态口味重另类| 亚洲最新视频在线观看| 久久99国内精品| 91精品福利视频| 欧美精品一区二区三区在线| 亚洲人成网站影音先锋播放| 另类小说色综合网站| 正在播放亚洲一区| 久久久久久99久久久精品网站| 欧美在线制服丝袜| 欧美疯狂性受xxxxx喷水图片| 国产视频不卡一区| 亚洲一区中文在线| 欧美日韩精品一区二区在线播放| 久久―日本道色综合久久| 国产精品中文欧美| 日韩久久一区二区| 99riav久久精品riav| 国产免费成人在线视频| 色综合久久综合中文综合网| 亚洲国产精品久久久久秋霞影院 | 欧美区一区二区三区| 美女一区二区久久| 欧美高清一级片在线观看| 在线视频中文字幕一区二区| 日韩成人一区二区三区在线观看| 精品国产免费视频| 波多野结衣一区二区三区| 亚洲免费三区一区二区| 欧美一二三在线| 国产成人精品午夜视频免费 | 欧美一区二区成人6969| 国内不卡的二区三区中文字幕| 中文字幕免费不卡| 欧美日韩国产一区| 极品少妇xxxx偷拍精品少妇| 亚洲欧美中日韩| 日韩欧美卡一卡二| 欧美日韩免费一区二区三区| 国产一本一道久久香蕉| 亚洲福利视频一区二区| 久久久www成人免费无遮挡大片| 色综合久久88色综合天天6| 亚洲va欧美va天堂v国产综合| 欧美变态口味重另类| 欧美三区免费完整视频在线观看| 国产一区二区在线观看免费| 亚洲综合成人在线视频| 国产日韩精品一区二区三区在线| 欧美在线观看你懂的| 国产精品资源网站| 亚洲第一成年网| 亚洲另类中文字| 国产精品无人区| 欧美mv日韩mv亚洲| 欧美精品久久久久久久多人混战| www.在线成人| 粉嫩一区二区三区性色av| 日韩电影一区二区三区| 性欧美疯狂xxxxbbbb| 亚洲色图视频网| 中文在线一区二区| 国产色产综合产在线视频| 欧美一区二区女人| 在线成人午夜影院| 日韩一区二区在线看片| 欧美精品三级日韩久久| 欧美在线视频不卡| 色欧美片视频在线观看| 99视频一区二区| www.欧美精品一二区| 成人av影院在线| 成人国产在线观看| 国产91丝袜在线播放0| 韩国成人福利片在线播放| 日本三级亚洲精品| 日韩国产在线观看| 五月开心婷婷久久| 青青青伊人色综合久久| 免费在线视频一区| 琪琪久久久久日韩精品| 日韩电影免费一区| 免费人成精品欧美精品| 日本特黄久久久高潮| 人人狠狠综合久久亚洲| 久久99精品久久只有精品| 毛片不卡一区二区| 国产在线一区观看| 成人污视频在线观看| 99国内精品久久| 在线观看亚洲精品| 日韩欧美亚洲国产另类| 久久久久国产精品厨房| 久久久精品国产免费观看同学| 中文幕一区二区三区久久蜜桃| 中文字幕一区二区三区在线不卡| 亚洲日本中文字幕区| 日韩理论在线观看| 五月天一区二区| 久久超碰97人人做人人爱| 国产suv一区二区三区88区| www.欧美日韩国产在线| 欧美色图第一页| 日韩精品一区二区三区视频播放 | 欧美一a一片一级一片| 欧美日韩国产综合一区二区三区 | 国产欧美一区二区在线| 日韩一区有码在线| 日韩在线一二三区| 国产一区二区在线视频| 91精品福利视频| 欧美成人精品1314www| 亚洲国产成人自拍| 亚洲sss视频在线视频| 国产在线播放一区三区四| 91蝌蚪porny| 日韩午夜在线影院| 亚洲人成7777| 九九热在线视频观看这里只有精品| 懂色av一区二区夜夜嗨| 欧美浪妇xxxx高跟鞋交| 久久久精品免费观看| 亚洲图片欧美激情| 福利一区福利二区| 欧美日韩黄色一区二区| 国产精品系列在线| 捆绑变态av一区二区三区| 色天使色偷偷av一区二区| 久久久三级国产网站| 亚洲电影在线免费观看| 成人爱爱电影网址| 日韩视频免费直播| 一区二区三区成人在线视频| 国产精品一区二区三区99| 欧美日韩激情在线| 国产精品三级av在线播放| 亚洲国产成人高清精品| 福利一区二区在线| 精品国产三级电影在线观看| 亚洲国产精品久久不卡毛片| 99re8在线精品视频免费播放| 欧美一区二区精品在线| 亚洲国产日韩综合久久精品| 国产成人精品免费网站| 精品国产区一区| 蜜臀av性久久久久av蜜臀妖精| 欧美视频一区二区|