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

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

?? pollq.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 version of PollQ. c is for use on systems that have limited stack
 * space and no display facilities.  The complete version can be found in
 * the Demo/Common/Full directory.
 *
 * Creates two tasks that communicate over a single queue.  One task acts as a
 * producer, the other a consumer.
 *
 * The producer loops for three iteration, posting an incrementing number onto the
 * queue each cycle.  It then delays for a fixed period before doing exactly the
 * same again.
 *
 * The consumer loops emptying the queue.  Each item removed from the queue is
 * checked to ensure it contains the expected value.  When the queue is empty it
 * blocks for a fixed period, then does the same again.
 *
 * All queue access is performed without blocking.  The consumer completely empties
 * the queue each time it runs so the producer should never find the queue full.
 *
 * An error is flagged if the consumer obtains an unexpected value or the producer
 * find the queue is full.
 */

/*
Changes from V2.0.0

	+ Delay periods are now specified using variables and constants of
	  portTickType rather than unsigned portLONG.
*/

#include <stdlib.h>

/* Scheduler include files. */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"

/* Demo program include files. */
#include "PollQ.h"

#define pollqSTACK_SIZE			configMINIMAL_STACK_SIZE
#define pollqQUEUE_SIZE			( 10 )
#define pollqPRODUCER_DELAY		( ( portTickType ) 200 / portTICK_RATE_MS )
#define pollqCONSUMER_DELAY		( pollqPRODUCER_DELAY - ( portTickType ) 20 )
#define pollqNO_DELAY			( ( portTickType ) 0 )
#define pollqVALUES_TO_PRODUCE	( ( signed portBASE_TYPE ) 3 )
#define pollqINITIAL_VALUE		( ( signed portBASE_TYPE ) 0 )

/* The task that posts the incrementing number onto the queue. */
static portTASK_FUNCTION_PROTO( vPolledQueueProducer, pvParameters );

/* The task that empties the queue. */
static portTASK_FUNCTION_PROTO( vPolledQueueConsumer, pvParameters );

/* Variables that are used to check that the tasks are still running with no
errors. */
static volatile signed portBASE_TYPE xPollingConsumerCount = pollqINITIAL_VALUE, xPollingProducerCount = pollqINITIAL_VALUE;

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

void vStartPolledQueueTasks( unsigned portBASE_TYPE uxPriority )
{
static xQueueHandle xPolledQueue;

	/* Create the queue used by the producer and consumer. */
	xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( unsigned portBASE_TYPE ) sizeof( unsigned portSHORT ) );

	/* Spawn the producer and consumer. */
	xTaskCreate( vPolledQueueConsumer, ( signed portCHAR * ) "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
	xTaskCreate( vPolledQueueProducer, ( signed portCHAR * ) "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
}
/*-----------------------------------------------------------*/

static portTASK_FUNCTION( vPolledQueueProducer, pvParameters )
{
unsigned portSHORT usValue = ( unsigned portSHORT ) 0;
signed portBASE_TYPE xError = pdFALSE, xLoop;

	for( ;; )
	{		
		for( xLoop = 0; xLoop < pollqVALUES_TO_PRODUCE; xLoop++ )
		{
			/* Send an incrementing number on the queue without blocking. */
			if( xQueueSend( *( ( xQueueHandle * ) pvParameters ), ( void * ) &usValue, pollqNO_DELAY ) != pdPASS )
			{
				/* We should never find the queue full so if we get here there
				has been an error. */
				xError = pdTRUE;
			}
			else
			{
				if( xError == pdFALSE )
				{
					/* If an error has ever been recorded we stop incrementing the
					check variable. */
					portENTER_CRITICAL();
						xPollingProducerCount++;
					portEXIT_CRITICAL();
				}

				/* Update the value we are going to post next time around. */
				usValue++;
			}
		}

		/* Wait before we start posting again to ensure the consumer runs and
		empties the queue. */
		vTaskDelay( pollqPRODUCER_DELAY );
	}
}  /*lint !e818 Function prototype must conform to API. */
/*-----------------------------------------------------------*/

static portTASK_FUNCTION( vPolledQueueConsumer, pvParameters )
{
unsigned portSHORT usData, usExpectedValue = ( unsigned portSHORT ) 0;
signed portBASE_TYPE xError = pdFALSE;

	for( ;; )
	{		
		/* Loop until the queue is empty. */
		while( uxQueueMessagesWaiting( *( ( xQueueHandle * ) pvParameters ) ) )
		{
			if( xQueueReceive( *( ( xQueueHandle * ) pvParameters ), &usData, pollqNO_DELAY ) == pdPASS )
			{
				if( usData != usExpectedValue )
				{
					/* This is not what we expected to receive so an error has
					occurred. */
					xError = pdTRUE;

					/* Catch-up to the value we received so our next expected
					value should again be correct. */
					usExpectedValue = usData;
				}
				else
				{
					if( xError == pdFALSE )
					{
						/* Only increment the check variable if no errors have
						occurred. */
						portENTER_CRITICAL();
							xPollingConsumerCount++;
						portEXIT_CRITICAL();
					}
				}

				/* Next time round we would expect the number to be one higher. */
				usExpectedValue++;
			}
		}

		/* Now the queue is empty we block, allowing the producer to place more
		items in the queue. */
		vTaskDelay( pollqCONSUMER_DELAY );
	}
} /*lint !e818 Function prototype must conform to API. */
/*-----------------------------------------------------------*/

/* This is called to check that all the created tasks are still running with no errors. */
portBASE_TYPE xArePollingQueuesStillRunning( void )
{
portBASE_TYPE xReturn;

	/* Check both the consumer and producer poll count to check they have both
	been changed since out last trip round.  We do not need a critical section
	around the check variables as this is called from a higher priority than
	the other tasks that access the same variables. */
	if( ( xPollingConsumerCount == pollqINITIAL_VALUE ) ||
		( xPollingProducerCount == pollqINITIAL_VALUE )
	  )
	{
		xReturn = pdFALSE;
	}
	else
	{
		xReturn = pdTRUE;
	}

	/* Set the check variables back down so we know if they have been
	incremented the next time around. */
	xPollingConsumerCount = pollqINITIAL_VALUE;
	xPollingProducerCount = pollqINITIAL_VALUE;

	return xReturn;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合天天综合在线视频| 国产不卡视频一区二区三区| 国产午夜久久久久| 精品国产区一区| 欧美精品一区二区三区高清aⅴ| 日韩精品专区在线| 精品久久久久久久久久久久包黑料| 欧美日韩亚州综合| 欧美一区二区三区在线观看| 日韩欧美国产综合一区| 精品国产a毛片| 国产日韩在线不卡| 国产精品大尺度| 亚洲素人一区二区| 亚洲成人在线网站| 激情五月婷婷综合| 成人黄色777网| 91女厕偷拍女厕偷拍高清| 色噜噜偷拍精品综合在线| 欧美日本精品一区二区三区| 欧美一级电影网站| 国产精品无圣光一区二区| 亚洲欧美在线视频观看| 日韩有码一区二区三区| 激情综合网天天干| 97精品国产97久久久久久久久久久久| 在线观看日产精品| 26uuu欧美| 亚洲九九爱视频| 激情综合五月婷婷| 在线观看日韩电影| 久久久蜜桃精品| 亚洲女同一区二区| 国产伦精一区二区三区| 色婷婷狠狠综合| 2020国产精品自拍| 亚洲激情网站免费观看| 精品一二三四区| 色婷婷综合在线| 久久久久国产精品厨房| 一区二区三区欧美久久| 国产经典欧美精品| 欧美精选午夜久久久乱码6080| 久久精品网站免费观看| 舔着乳尖日韩一区| 91香蕉视频在线| 久久尤物电影视频在线观看| 亚洲影院在线观看| 成人av电影在线网| 国产欧美精品一区二区色综合| 亚洲成人精品影院| 在线免费观看视频一区| 国产女人水真多18毛片18精品视频| 亚洲成人精品一区二区| 91香蕉视频污| 国产精品国产三级国产三级人妇| 久久www免费人成看片高清| 欧美日韩国产美| 一二三区精品视频| 日本久久一区二区三区| 国产精品水嫩水嫩| 国产成人一区在线| 精品乱码亚洲一区二区不卡| 午夜精品久久久| 欧美午夜精品一区二区三区| 中文一区二区在线观看| 国产麻豆精品在线| xnxx国产精品| 激情小说欧美图片| 久久免费精品国产久精品久久久久| 午夜精品视频一区| 在线播放一区二区三区| 亚洲国产日韩精品| 在线91免费看| 天天色天天操综合| 在线不卡的av| 麻豆国产精品777777在线| 欧美一级xxx| 国精产品一区一区三区mba桃花 | av亚洲精华国产精华精| 久久久久一区二区三区四区| 国产一区二区导航在线播放| 亚洲精品在线三区| 国产69精品久久久久毛片| 欧美韩国日本不卡| 在线日韩一区二区| 蜜乳av一区二区| 久久这里只有精品视频网| 国产精品一级片| ●精品国产综合乱码久久久久| 一本色道**综合亚洲精品蜜桃冫| 一区二区三区波多野结衣在线观看 | 6080国产精品一区二区| 久久国内精品自在自线400部| 久久奇米777| 色哟哟一区二区| 婷婷国产在线综合| 久久久久久久久久久久久夜| 国产不卡视频一区| 亚洲成人在线观看视频| 久久先锋影音av| 91麻豆成人久久精品二区三区| 亚洲综合图片区| 久久一区二区视频| 欧美亚洲另类激情小说| 国模大尺度一区二区三区| 亚洲视频免费在线| 日韩欧美国产综合一区 | 欧美第一区第二区| 成人av小说网| 奇米在线7777在线精品| 国产精品日日摸夜夜摸av| 欧美浪妇xxxx高跟鞋交| 国产精品1区二区.| 婷婷中文字幕一区三区| 国产色婷婷亚洲99精品小说| 欧美卡1卡2卡| 成人性生交大片免费看在线播放| 亚洲一线二线三线久久久| 国产亚洲一区二区在线观看| 色老汉一区二区三区| 国产一区二区三区观看| 亚洲电影在线免费观看| 国产精品二区一区二区aⅴ污介绍| 在线不卡一区二区| 色av一区二区| 成人福利电影精品一区二区在线观看| 首页综合国产亚洲丝袜| 亚洲视频在线一区观看| 久久免费看少妇高潮| 日韩欧美一级精品久久| 欧美色精品在线视频| 不卡电影一区二区三区| 国产乱码精品一区二区三区忘忧草 | 韩国女主播成人在线| 日韩电影网1区2区| 亚洲无线码一区二区三区| 亚洲另类在线制服丝袜| 综合久久久久久| 久久久久久久综合狠狠综合| 日韩欧美成人一区| 日韩视频免费观看高清完整版| 欧美在线视频全部完| 色婷婷av一区二区三区软件| av电影天堂一区二区在线| 成人小视频免费观看| 国产98色在线|日韩| 国产精品一二一区| 国产成人av电影在线观看| 国产成人av电影在线播放| 国产真实乱子伦精品视频| 久久国产剧场电影| 老色鬼精品视频在线观看播放| 日韩精品视频网站| 激情综合一区二区三区| 国产精品中文字幕欧美| 国产成人精品影视| 成人成人成人在线视频| 91麻豆.com| 欧美网站一区二区| 91精品在线观看入口| 日韩欧美在线1卡| 久久品道一品道久久精品| 中文字幕精品一区| 亚洲精品水蜜桃| 亚洲国产视频直播| 九九**精品视频免费播放| 国产一本一道久久香蕉| 成人av手机在线观看| 欧美性大战久久久| 日韩欧美一区二区在线视频| 精品国产成人系列| 国产精品久久久久久久久免费相片| 国产精品国产自产拍高清av王其| 亚洲毛片av在线| 免费观看在线综合色| 国产成人无遮挡在线视频| 99久久免费视频.com| 欧美久久高跟鞋激| 国产三级精品三级在线专区| 亚洲综合久久久| 国产在线播放一区二区三区| eeuss鲁一区二区三区| 欧美日韩免费高清一区色橹橹 | 成人的网站免费观看| 欧美色视频一区| 久久久久久久久蜜桃| 亚洲一区二区偷拍精品| 国产伦精品一区二区三区免费| 成人国产精品免费观看视频| 欧美日韩久久不卡| 亚洲国产精品v| 美女一区二区视频| 91小宝寻花一区二区三区| 亚洲精品在线观看网站| 亚洲午夜在线观看视频在线| 播五月开心婷婷综合| 日韩免费视频一区| 亚洲国产视频一区| 成人动漫一区二区|