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

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

?? integer.c

?? Este é um rtos free para a familia arm7
?? C
字號(hào):
/*
	FreeRTOS V4.0.0 - Copyright (C) 2003-2006 Richard Barry.

	This file is part of the FreeRTOS distribution.

	FreeRTOS 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 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; 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, 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.
	***************************************************************************
*/

/*
Changes from V1.2.3
	
	+ The created tasks now include calls to tskYIELD(), allowing them to be used
	  with the cooperative scheduler.
*/

/**
 * This does the same as flop. c, but uses variables of type long instead of 
 * type double.  
 *
 * As with flop. c, the tasks created in this file are a good test of the 
 * scheduler context switch mechanism.  The processor has to access 32bit 
 * variables in two or four chunks (depending on the processor).  The low 
 * priority of these tasks means there is a high probability that a context 
 * switch will occur mid calculation.  See the flop. c documentation for 
 * more information.
 *
 * \page IntegerC integer.c
 * \ingroup DemoFiles
 * <HR>
 */

/*
Changes from V1.2.1

	+ The constants used in the calculations are larger to ensure the
	  optimiser does not truncate them to 16 bits.
*/

#include <stdlib.h>

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

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

#define intgSTACK_SIZE		( ( unsigned portSHORT ) 256 )
#define intgNUMBER_OF_TASKS  ( 8 )

/* Four tasks, each of which performs a different calculation on four byte 
variables.  Each of the four is created twice. */
static void vCompeteingIntMathTask1( void *pvParameters );
static void vCompeteingIntMathTask2( void *pvParameters );
static void vCompeteingIntMathTask3( void *pvParameters );
static void vCompeteingIntMathTask4( void *pvParameters );

/* These variables are used to check that all the tasks are still running.  If a 
task gets a calculation wrong it will stop incrementing its check variable. */
static volatile unsigned portSHORT usTaskCheck[ intgNUMBER_OF_TASKS ] = { ( unsigned portSHORT ) 0 };
/*-----------------------------------------------------------*/

void vStartIntegerMathTasks( unsigned portBASE_TYPE uxPriority )
{
	xTaskCreate( vCompeteingIntMathTask1, "IntMath1", intgSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, NULL );
	xTaskCreate( vCompeteingIntMathTask2, "IntMath2", intgSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, NULL );
	xTaskCreate( vCompeteingIntMathTask3, "IntMath3", intgSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, NULL );
	xTaskCreate( vCompeteingIntMathTask4, "IntMath4", intgSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, NULL );
	xTaskCreate( vCompeteingIntMathTask1, "IntMath5", intgSTACK_SIZE, ( void * ) &( usTaskCheck[ 4 ] ), uxPriority, NULL );
	xTaskCreate( vCompeteingIntMathTask2, "IntMath6", intgSTACK_SIZE, ( void * ) &( usTaskCheck[ 5 ] ), uxPriority, NULL );
	xTaskCreate( vCompeteingIntMathTask3, "IntMath7", intgSTACK_SIZE, ( void * ) &( usTaskCheck[ 6 ] ), uxPriority, NULL );
	xTaskCreate( vCompeteingIntMathTask4, "IntMath8", intgSTACK_SIZE, ( void * ) &( usTaskCheck[ 7 ] ), uxPriority, NULL );
}
/*-----------------------------------------------------------*/

static void vCompeteingIntMathTask1( void *pvParameters )
{
portLONG l1, l2, l3, l4;
portSHORT sError = pdFALSE;
volatile unsigned portSHORT *pusTaskCheckVariable;
const portLONG lAnswer = ( ( portLONG ) 74565L + ( portLONG ) 1234567L ) * ( portLONG ) -918L;
const portCHAR * const pcTaskStartMsg = "Integer math task 1 started.\r\n";
const portCHAR * const pcTaskFailMsg = "Integer math task 1 failed.\r\n";

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

	/* The variable this task increments to show it is still running is passed in
	as the parameter. */
	pusTaskCheckVariable = ( unsigned portSHORT * ) pvParameters;

	/* Keep performing a calculation and checking the result against a constant. */
	for(;;)
	{
		l1 = ( portLONG ) 74565L;
		l2 = ( portLONG ) 1234567L;
		l3 = ( portLONG ) -918L;

		l4 = ( l1 + l2 ) * l3;

		taskYIELD();

		/* If the calculation does not match the expected constant, stop the
		increment of the check variable. */
		if( l4 != lAnswer )
		{
			vPrintDisplayMessage( &pcTaskFailMsg );
			sError = pdTRUE;
		}

		if( sError == pdFALSE )
		{
			/* If the calculation has always been correct, increment the check
			variable so we know	this task is still running okay. */
			( *pusTaskCheckVariable )++;
		}
	}
}
/*-----------------------------------------------------------*/

static void vCompeteingIntMathTask2( void *pvParameters )
{
portLONG l1, l2, l3, l4;
portSHORT sError = pdFALSE;
volatile unsigned portSHORT *pusTaskCheckVariable;
const portLONG lAnswer = ( ( portLONG ) -389000L / ( portLONG ) 329999L ) * ( portLONG ) -89L;
const portCHAR * const pcTaskStartMsg = "Integer math task 2 started.\r\n";
const portCHAR * const pcTaskFailMsg = "Integer math task 2 failed.\r\n";

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

	/* The variable this task increments to show it is still running is passed in
	as the parameter. */
	pusTaskCheckVariable = ( unsigned portSHORT * ) pvParameters;

	/* Keep performing a calculation and checking the result against a constant. */
	for( ;; )
	{
		l1 = -389000L;
		l2 = 329999L;
		l3 = -89L;

		l4 = ( l1 / l2 ) * l3;

		taskYIELD();

		/* If the calculation does not match the expected constant, stop the
		increment of the check variable. */
		if( l4 != lAnswer )
		{
			vPrintDisplayMessage( &pcTaskFailMsg );
			sError = pdTRUE;
		}

		if( sError == pdFALSE )
		{
			/* If the calculation has always been correct, increment the check
			variable so we know this task is still running okay. */
			( *pusTaskCheckVariable )++;
		}
	}
}
/*-----------------------------------------------------------*/

static void vCompeteingIntMathTask3( void *pvParameters )
{
portLONG *plArray, lTotal1, lTotal2;
portSHORT sError = pdFALSE;
volatile unsigned portSHORT *pusTaskCheckVariable;
const unsigned portSHORT usArraySize = ( unsigned portSHORT ) 250;
unsigned portSHORT usPosition;
const portCHAR * const pcTaskStartMsg = "Integer math task 3 started.\r\n";
const portCHAR * const pcTaskFailMsg = "Integer math task 3 failed.\r\n";

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

	/* The variable this task increments to show it is still running is passed in
	as the parameter. */
	pusTaskCheckVariable = ( unsigned portSHORT * ) pvParameters;

	/* Create the array we are going to use for our check calculation. */
	plArray = ( portLONG * ) pvPortMalloc( ( size_t ) 250 * sizeof( portLONG ) );

	/* Keep filling the array, keeping a running total of the values placed in the
	array.  Then run through the array adding up all the values.  If the two totals
	do not match, stop the check variable from incrementing. */
	for( ;; )
	{
		lTotal1 = ( portLONG ) 0;
		lTotal2 = ( portLONG ) 0;

		for( usPosition = 0; usPosition < usArraySize; usPosition++ )
		{
			plArray[ usPosition ] = ( portLONG ) usPosition + ( portLONG ) 5;
			lTotal1 += ( portLONG ) usPosition + ( portLONG ) 5;
		}

		taskYIELD();

		for( usPosition = 0; usPosition < usArraySize; usPosition++ )
		{
			lTotal2 += plArray[ usPosition ];
		}

		if( lTotal1 != lTotal2 )
		{
			vPrintDisplayMessage( &pcTaskFailMsg );
			sError = pdTRUE;
		}

		taskYIELD();

		if( sError == pdFALSE )
		{
			/* If the calculation has always been correct, increment the check
			variable so we know	this task is still running okay. */
			( *pusTaskCheckVariable )++;
		}
	}
}
/*-----------------------------------------------------------*/

static void vCompeteingIntMathTask4( void *pvParameters )
{
portLONG *plArray, lTotal1, lTotal2;
portSHORT sError = pdFALSE;
volatile unsigned portSHORT *pusTaskCheckVariable;
const unsigned portSHORT usArraySize = 250;
unsigned portSHORT usPosition;
const portCHAR * const pcTaskStartMsg = "Integer math task 4 started.\r\n";
const portCHAR * const pcTaskFailMsg = "Integer math task 4 failed.\r\n";

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

	/* The variable this task increments to show it is still running is passed in
	as the parameter. */
	pusTaskCheckVariable = ( unsigned portSHORT * ) pvParameters;

	/* Create the array we are going to use for our check calculation. */
	plArray = ( portLONG * ) pvPortMalloc( ( size_t ) 250 * sizeof( portLONG ) );

	/* Keep filling the array, keeping a running total of the values placed in the 
	array.  Then run through the array adding up all the values.  If the two totals 
	do not match, stop the check variable from incrementing. */
	for( ;; )
	{
		lTotal1 = ( portLONG ) 0;
		lTotal2 = ( portLONG ) 0;

		for( usPosition = 0; usPosition < usArraySize; usPosition++ )
		{
			plArray[ usPosition ] = ( portLONG ) usPosition * ( portLONG ) 12;
			lTotal1 += ( portLONG ) usPosition * ( portLONG ) 12;	
		}

		taskYIELD();
	
		for( usPosition = 0; usPosition < usArraySize; usPosition++ )
		{
			lTotal2 += plArray[ usPosition ];
		}


		if( lTotal1 != lTotal2 )
		{
			vPrintDisplayMessage( &pcTaskFailMsg );
			sError = pdTRUE;
		}

		taskYIELD();

		if( sError == pdFALSE )
		{
			/* If the calculation has always been correct, increment the check 
			variable so we know	this task is still running okay. */
			( *pusTaskCheckVariable )++;
		}
	}
}
/*-----------------------------------------------------------*/

/* This is called to check that all the created tasks are still running. */
portBASE_TYPE xAreIntegerMathsTaskStillRunning( void )
{
/* Keep a history of the check variables so we know if they have been incremented 
since the last call. */
static unsigned portSHORT usLastTaskCheck[ intgNUMBER_OF_TASKS ] = { ( unsigned portSHORT ) 0 };
portBASE_TYPE xReturn = pdTRUE, xTask;

	/* Check the maths tasks are still running by ensuring their check variables 
	are still incrementing. */
	for( xTask = 0; xTask < intgNUMBER_OF_TASKS; xTask++ )
	{
		if( usTaskCheck[ xTask ] == usLastTaskCheck[ xTask ] )
		{
			/* The check has not incremented so an error exists. */
			xReturn = pdFALSE;
		}

		usLastTaskCheck[ xTask ] = usTaskCheck[ xTask ];
	}

	return xReturn;
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99精品一区二区三区| 视频精品一区二区| 91麻豆精品久久久久蜜臀| 色呦呦一区二区三区| 不卡的av在线| 99精品国产91久久久久久| eeuss鲁片一区二区三区| 成人免费福利片| 99久久精品国产毛片| 一本大道av伊人久久综合| 色美美综合视频| 欧美日韩一区二区三区在线| 欧美艳星brazzers| 欧美一区日韩一区| 欧美精品一区二区三区高清aⅴ | 国产精品大尺度| 国产精品色哟哟网站| 亚洲免费av观看| 香港成人在线视频| 韩国女主播成人在线观看| 美女久久久精品| 从欧美一区二区三区| 色女孩综合影院| 欧美一级淫片007| 国产欧美一区二区精品婷婷| 国产精品日韩精品欧美在线| 中文字幕一区二区三区色视频| 日韩伦理电影网| 午夜精品国产更新| 国产一区二区美女诱惑| 99精品视频一区二区| 欧美三级电影在线看| 正在播放一区二区| 中文字幕+乱码+中文字幕一区| 亚洲男人的天堂在线aⅴ视频| 三级成人在线视频| 国产精品亚洲第一区在线暖暖韩国 | 亚洲欧洲综合另类在线| 亚洲观看高清完整版在线观看| 奇米精品一区二区三区在线观看 | 色婷婷精品大在线视频 | 精品国产乱码久久久久久图片 | 久久se精品一区精品二区| 国产成人av福利| 欧美片网站yy| 1024国产精品| 精品无人区卡一卡二卡三乱码免费卡| 成人国产一区二区三区精品| 欧美二区三区的天堂| 亚洲欧洲一区二区在线播放| 日本午夜一区二区| 91免费在线看| 国产亚洲一区二区三区| 日本美女视频一区二区| 色婷婷综合久久久久中文| 国产午夜精品在线观看| 蜜桃视频一区二区| 91福利精品视频| 国产三区在线成人av| 久久精品国产亚洲5555| 欧美日本视频在线| 一区二区三区日韩精品视频| 国产成人免费视频精品含羞草妖精| 欧美日韩国产电影| 亚洲精品欧美二区三区中文字幕| 国产精品综合在线视频| 日韩精品最新网址| 三级欧美在线一区| 欧美日韩精品福利| 亚洲18女电影在线观看| 在线看日本不卡| 亚洲美女偷拍久久| 91麻豆产精品久久久久久| 国产精品久久久久久妇女6080 | 在线观看av不卡| 自拍偷拍亚洲激情| 91蜜桃免费观看视频| 日本一区二区三区dvd视频在线| 激情欧美一区二区| www成人在线观看| 韩国欧美国产一区| 久久久不卡网国产精品一区| 国产综合久久久久久鬼色 | 91福利国产成人精品照片| 亚洲私人黄色宅男| 欧美在线制服丝袜| 亚洲午夜激情网页| 制服丝袜亚洲播放| 国产在线精品一区二区三区不卡 | 欧美精品丝袜中出| 蜜臀av亚洲一区中文字幕| 日韩精品一区二| 国产精品一品二品| 亚洲乱码国产乱码精品精小说| 色婷婷综合在线| 图片区小说区国产精品视频| 欧美videossexotv100| 不卡电影一区二区三区| 亚洲精品v日韩精品| 欧美少妇性性性| 免费观看在线综合色| 久久久精品免费免费| 91在线精品一区二区| 日韩成人av影视| 国产日本欧美一区二区| 在线视频欧美精品| 日本中文字幕一区二区视频 | 亚洲精品一二三区| 欧美一区二区三区四区视频| 国产成人午夜精品影院观看视频| 亚洲日本成人在线观看| 欧美一区二区三区公司| 国产99精品国产| 亚洲美女偷拍久久| 久久久亚洲精华液精华液精华液| 91蜜桃网址入口| 国产综合久久久久影院| 亚洲国产婷婷综合在线精品| 国产亚洲综合av| 欧美一三区三区四区免费在线看| 成人午夜激情在线| 美女爽到高潮91| 一区2区3区在线看| 久久综合九色综合97婷婷女人| 日本久久一区二区| 粉嫩av一区二区三区在线播放 | 尤物视频一区二区| 国产欧美精品一区二区色综合 | 久久综合色天天久久综合图片| 色88888久久久久久影院按摩| 国产综合色视频| 日韩av中文字幕一区二区三区| 亚洲欧洲成人精品av97| 久久色在线视频| 欧美一级在线免费| 欧美日韩国产区一| 色哟哟日韩精品| 粉嫩欧美一区二区三区高清影视| 日韩国产精品久久久| 亚洲欧美电影院| 亚洲国产电影在线观看| 欧美成人女星排行榜| 91精品国产欧美一区二区成人| 欧美亚洲国产一区二区三区va| 成人黄色av网站在线| 国产美女一区二区| 国产一区二区不卡在线| 久久电影网站中文字幕| 日韩和欧美一区二区| 午夜精品一区在线观看| 一区二区三区不卡在线观看 | 欧美性xxxxx极品少妇| 99久久久久免费精品国产 | 美女在线一区二区| 免费人成在线不卡| 秋霞av亚洲一区二区三| 午夜精品久久久| 奇米综合一区二区三区精品视频| 丝瓜av网站精品一区二区 | 国内一区二区视频| 国产精品一二三在| 成人性生交大片免费看中文网站| 国产成都精品91一区二区三| 国产精品性做久久久久久| 国产99精品国产| 91在线播放网址| 日本道精品一区二区三区| 色综合欧美在线视频区| 欧美自拍偷拍一区| 日韩一区二区在线看片| 久久综合国产精品| 国产精品传媒视频| 亚洲综合色成人| 午夜精品久久久久久久久久| 久久精工是国产品牌吗| 国产麻豆精品95视频| 99久久久免费精品国产一区二区 | 精品一区二区三区视频在线观看| 久久97超碰国产精品超碰| 成人在线综合网站| 欧美午夜不卡在线观看免费| 日韩欧美国产系列| 国产精品三级av| 婷婷亚洲久悠悠色悠在线播放 | 成人高清免费观看| 欧美性大战久久久久久久蜜臀| 日韩欧美亚洲另类制服综合在线| 久久久蜜臀国产一区二区| 国产精品灌醉下药二区| 日韩黄色一级片| 99精品视频在线观看| 日韩欧美中文一区二区| 国产精品久久免费看| 视频在线在亚洲| www.日韩大片| 精品少妇一区二区三区日产乱码 | 在线播放91灌醉迷j高跟美女 | 国产剧情一区在线| 欧美丝袜丝交足nylons图片| 国产性色一区二区|