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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? pollq.c

?? 最新版FreeRTOS, 包擴多種開發(fā)平臺的移植
?? 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 is a very simple queue test.  See the BlockQ. c documentation for a more 
 * comprehensive version.
 *
 * 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.
 *
 * \page PollQC pollQ.c
 * \ingroup DemoFiles
 * <HR>
 */

/*
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"
#include "print.h"

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

#define pollqSTACK_SIZE		( ( unsigned portSHORT ) 128 )

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

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

/* Variables that are used to check that the tasks are still running with no errors. */
static volatile portSHORT sPollingConsumerCount = 0, sPollingProducerCount = 0;
/*-----------------------------------------------------------*/

void vStartPolledQueueTasks( unsigned portBASE_TYPE uxPriority )
{
static xQueueHandle xPolledQueue;
const unsigned portBASE_TYPE uxQueueSize = 10;

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

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

static void vPolledQueueProducer( void *pvParameters )
{
unsigned portSHORT usValue = 0, usLoop;
xQueueHandle *pxQueue;
const portTickType xDelay = ( portTickType ) 200 / portTICK_RATE_MS;
const unsigned portSHORT usNumToProduce = 3;
const portCHAR * const pcTaskStartMsg = "Polled queue producer started.\r\n";
const portCHAR * const pcTaskErrorMsg = "Could not post on polled queue.\r\n";
portSHORT sError = pdFALSE;

	/* Queue a message for printing to say the task has started. */
	vPrintDisplayMessage( &pcTaskStartMsg );

	/* The queue being used is passed in as the parameter. */
	pxQueue = ( xQueueHandle * ) pvParameters;

	for( ;; )
	{		
		for( usLoop = 0; usLoop < usNumToProduce; ++usLoop )
		{
			/* Send an incrementing number on the queue without blocking. */
			if( xQueueSend( *pxQueue, ( void * ) &usValue, ( portTickType ) 0 ) != pdPASS )
			{
				/* We should never find the queue full - this is an error. */
				vPrintDisplayMessage( &pcTaskErrorMsg );
				sError = pdTRUE;
			}
			else
			{
				if( sError == pdFALSE )
				{
					/* If an error has ever been recorded we stop incrementing the 
					check variable. */
					++sPollingProducerCount;
				}

				/* 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( xDelay );
	}
}
/*-----------------------------------------------------------*/

static void vPolledQueueConsumer( void *pvParameters )
{
unsigned portSHORT usData, usExpectedValue = 0;
xQueueHandle *pxQueue;
const portTickType xDelay = ( portTickType ) 200 / portTICK_RATE_MS;
const portCHAR * const pcTaskStartMsg = "Polled queue consumer started.\r\n";
const portCHAR * const pcTaskErrorMsg = "Incorrect value received on polled queue.\r\n";
portSHORT sError = pdFALSE;

	/* Queue a message for printing to say the task has started. */
	vPrintDisplayMessage( &pcTaskStartMsg );

	/* The queue being used is passed in as the parameter. */
	pxQueue = ( xQueueHandle * ) pvParameters;

	for( ;; )
	{		
		/* Loop until the queue is empty. */
		while( uxQueueMessagesWaiting( *pxQueue ) )
		{
			if( xQueueReceive( *pxQueue, &usData, ( portTickType ) 0 ) == pdPASS )
			{
				if( usData != usExpectedValue )
				{
					/* This is not what we expected to receive so an error has 
					occurred. */
					vPrintDisplayMessage( &pcTaskErrorMsg );
					sError = pdTRUE;
					/* Catch-up to the value we received so our next expected value 
					should again be correct. */
					usExpectedValue = usData;
				}
				else
				{
					if( sError == pdFALSE )
					{
						/* Only increment the check variable if no errors have 
						occurred. */
						++sPollingConsumerCount;
					}
				}
				++usExpectedValue;
			}
		}

		/* Now the queue is empty we block, allowing the producer to place more 
		items in the queue. */
		vTaskDelay( xDelay );
	}
}
/*-----------------------------------------------------------*/

/* This is called to check that all the created tasks are still running with no errors. */
portBASE_TYPE xArePollingQueuesStillRunning( void )
{
static portSHORT sLastPollingConsumerCount = 0, sLastPollingProducerCount = 0;
portBASE_TYPE xReturn;

	if( ( sLastPollingConsumerCount == sPollingConsumerCount ) ||
		( sLastPollingProducerCount == sPollingProducerCount ) 
	  )
	{
		xReturn = pdFALSE;
	}
	else
	{
		xReturn = pdTRUE;
	}

	sLastPollingConsumerCount = sPollingConsumerCount;
	sLastPollingProducerCount = sPollingProducerCount;

	return xReturn;
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人教育av在线| 欧美精品一卡两卡| 欧美色视频一区| 久久综合网色—综合色88| 亚洲精品成a人| 国产精品69毛片高清亚洲| 欧美亚洲国产一卡| 国产精品看片你懂得| 蜜桃视频在线一区| 91成人在线免费观看| 国产情人综合久久777777| 日韩国产欧美三级| 欧美中文字幕一区二区三区亚洲 | 久久精品一区二区| 亚洲综合久久久久| 97国产一区二区| 国产欧美精品一区| 国产真实乱子伦精品视频| 7777精品伊人久久久大香线蕉超级流畅| 国产精品毛片高清在线完整版| 久久国产日韩欧美精品| 欧美一区二区三区在线观看视频 | 欧美日韩国产一级| 亚洲色图一区二区| aa级大片欧美| 亚洲私人黄色宅男| 91视频免费看| 自拍偷拍国产精品| 99re在线精品| 亚洲裸体xxx| 99精品视频一区二区| 中文字幕亚洲一区二区va在线| 国内成人自拍视频| 久久久亚洲欧洲日产国码αv| 狠狠网亚洲精品| 欧美mv日韩mv国产网站app| 日韩精品国产欧美| 日韩一区二区免费在线电影| 日韩专区欧美专区| 日韩视频一区二区三区| 另类综合日韩欧美亚洲| 精品国产乱码久久久久久浪潮| 国产在线国偷精品免费看| 久久久久久99久久久精品网站| 国产乱码精品一区二区三区忘忧草 | 在线综合视频播放| 久久国产免费看| 久久精品男人天堂av| 成人激情免费视频| 亚洲精品免费一二三区| 欧美日韩一区中文字幕| 日本va欧美va瓶| 国产色产综合色产在线视频| 99久久精品免费观看| 亚洲福利一二三区| 欧美精品一区二区高清在线观看| 国产精品综合av一区二区国产馆| 国产精品久久久久久亚洲毛片| 在线一区二区三区四区五区| 天天色综合成人网| 久久久久久久久久久99999| 91亚洲精品一区二区乱码| 香蕉久久夜色精品国产使用方法| 欧美成人一区二区| 成人av在线一区二区三区| 亚洲国产欧美日韩另类综合| 日韩精品中午字幕| 99精品国产91久久久久久| 日本亚洲视频在线| 国产精品白丝在线| 日韩欧美激情在线| 在线一区二区视频| 国产美女在线精品| 亚洲一卡二卡三卡四卡| 久久夜色精品国产噜噜av| 一本一本久久a久久精品综合麻豆| 免费观看日韩电影| 亚洲丝袜另类动漫二区| 久久久午夜精品理论片中文字幕| 在线免费精品视频| 国产成人av电影在线播放| 日韩中文字幕一区二区三区| 国产精品视频一区二区三区不卡| 欧美日韩午夜影院| 99国产精品一区| 韩国欧美国产一区| 日韩激情视频网站| 亚洲一区二区三区四区五区中文| 国产性天天综合网| 3751色影院一区二区三区| 91天堂素人约啪| 成人一区二区视频| 久久爱另类一区二区小说| 午夜日韩在线电影| 亚洲精品国产成人久久av盗摄| 国产精品嫩草影院com| 久久综合色天天久久综合图片| 欧美视频一区二区三区四区 | 91小视频免费看| 国产高清一区日本| 国产在线播放一区二区三区| 五月激情综合网| 一区二区三区在线不卡| 成人欧美一区二区三区视频网页| 国产网红主播福利一区二区| 久久亚洲精华国产精华液| 欧美一区二区三区免费观看视频| 欧美久久久久免费| 欧美肥妇free| 欧美蜜桃一区二区三区| 欧美日韩美少妇| 欧美日韩另类国产亚洲欧美一级| 色婷婷综合激情| 欧美日韩一级视频| 欧美日韩在线亚洲一区蜜芽| 欧美中文字幕一区| 欧美日韩国产大片| 91精品国产综合久久精品性色| 欧美中文字幕一区| 3atv一区二区三区| 久久一区二区视频| 亚洲国产高清aⅴ视频| 国产精品久久久久一区 | 国产亚洲短视频| 国产精品国产三级国产三级人妇| 中文字幕欧美一| 一区二区三区在线影院| 悠悠色在线精品| 午夜国产不卡在线观看视频| 日韩国产成人精品| 久久99久久久久| 国产成人精品一区二区三区四区 | 国产精品一级片在线观看| 国内精品伊人久久久久av影院 | 香蕉加勒比综合久久| 蜜桃av噜噜一区| 国产91高潮流白浆在线麻豆| eeuss鲁片一区二区三区| 色天天综合久久久久综合片| 欧美精品一二三区| 欧美变态口味重另类| 国产婷婷精品av在线| 亚洲另类色综合网站| 日本午夜一本久久久综合| 国内一区二区在线| 91丨porny丨在线| 制服丝袜成人动漫| 欧美国产精品劲爆| 首页综合国产亚洲丝袜| 国产一本一道久久香蕉| 欧美在线观看视频在线| 精品免费国产二区三区| 亚洲天堂免费在线观看视频| 日本成人在线看| 91免费在线播放| 欧美tickling挠脚心丨vk| 亚洲精品你懂的| 国产精品一二三在| 欧美视频一区在线| 国产精品午夜免费| 麻豆freexxxx性91精品| 99久久99久久综合| 久久久综合视频| 日韩在线一二三区| 91同城在线观看| 久久久国产精华| 日韩av午夜在线观看| 色88888久久久久久影院按摩 | 欧美浪妇xxxx高跟鞋交| 国产精品青草综合久久久久99| 日韩国产精品大片| 欧美在线看片a免费观看| 欧美激情一区在线观看| 久久精品99久久久| 欧美精品国产精品| 一区二区在线观看不卡| 国产成人在线电影| 日韩三级电影网址| 亚欧色一区w666天堂| 99精品1区2区| 中文字幕欧美一区| 成人一区二区三区中文字幕| 精品国产3级a| 欧美96一区二区免费视频| 欧美性大战久久久久久久蜜臀| 日本一区二区电影| 国产成人在线观看免费网站| 精品三级在线观看| 蜜臀国产一区二区三区在线播放| 欧美日韩不卡在线| 亚洲午夜私人影院| 欧美色老头old∨ideo| 一区二区三区美女视频| 99国产一区二区三精品乱码| 国产精品国产三级国产aⅴ入口| 国产成人精品免费| 国产视频一区在线观看| 国产91清纯白嫩初高中在线观看| 久久久久国产精品厨房| 国产成人免费在线观看|