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

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

?? flop.c

?? 最新版FreeRTOS, 包擴(kuò)多種開發(fā)平臺(tái)的移植
?? C
字號(hào):
/*
	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.
	***************************************************************************
*/

/*
 * Creates eight tasks, each of which loops continuously performing an (emulated) 
 * floating point calculation.
 *
 * All the tasks run at the idle priority and never block or yield.  This causes 
 * all eight tasks to time slice with the idle task.  Running at the idle priority 
 * means that these tasks will get pre-empted any time another task is ready to run
 * or a time slice occurs.  More often than not the pre-emption will occur mid 
 * calculation, creating a good test of the schedulers context switch mechanism - a 
 * calculation producing an unexpected result could be a symptom of a corruption in 
 * the context of a task.
 */

#include <stdlib.h>
#include <math.h>

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

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

#define mathSTACK_SIZE		configMINIMAL_STACK_SIZE
#define mathNUMBER_OF_TASKS  ( 8 )

/* Four tasks, each of which performs a different floating point calculation.  
Each of the four is created twice. */
static portTASK_FUNCTION_PROTO( vCompetingMathTask1, pvParameters );
static portTASK_FUNCTION_PROTO( vCompetingMathTask2, pvParameters );
static portTASK_FUNCTION_PROTO( vCompetingMathTask3, pvParameters );
static portTASK_FUNCTION_PROTO( vCompetingMathTask4, 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[ mathNUMBER_OF_TASKS ] = { ( unsigned portSHORT ) 0 };

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

void vStartMathTasks( unsigned portBASE_TYPE uxPriority )
{
	xTaskCreate( vCompetingMathTask1, ( signed portCHAR * ) "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, NULL );
	xTaskCreate( vCompetingMathTask2, ( signed portCHAR * ) "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, NULL );
	xTaskCreate( vCompetingMathTask3, ( signed portCHAR * ) "Math3", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 2 ] ), uxPriority, NULL );
	xTaskCreate( vCompetingMathTask4, ( signed portCHAR * ) "Math4", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 3 ] ), uxPriority, NULL );
	xTaskCreate( vCompetingMathTask1, ( signed portCHAR * ) "Math5", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 4 ] ), uxPriority, NULL );
	xTaskCreate( vCompetingMathTask2, ( signed portCHAR * ) "Math6", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 5 ] ), uxPriority, NULL );
	xTaskCreate( vCompetingMathTask3, ( signed portCHAR * ) "Math7", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 6 ] ), uxPriority, NULL );
	xTaskCreate( vCompetingMathTask4, ( signed portCHAR * ) "Math8", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 7 ] ), uxPriority, NULL );
}
/*-----------------------------------------------------------*/

static portTASK_FUNCTION( vCompetingMathTask1, pvParameters )
{
volatile portDOUBLE d1, d2, d3, d4;
volatile unsigned portSHORT *pusTaskCheckVariable;
volatile portDOUBLE dAnswer;
portSHORT sError = pdFALSE;

	d1 = 123.4567;
	d2 = 2345.6789;
	d3 = -918.222;

	dAnswer = ( d1 + d2 ) * d3;

	/* 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(;;)
	{
		d1 = 123.4567;
		d2 = 2345.6789;
		d3 = -918.222;

		d4 = ( d1 + d2 ) * d3;

		#if configUSE_PREEMPTION == 0
			taskYIELD();
		#endif

		/* If the calculation does not match the expected constant, stop the 
		increment of the check variable. */
		if( fabs( d4 - dAnswer ) > 0.001 )
		{
			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 )++;
		}

		#if configUSE_PREEMPTION == 0
			taskYIELD();
		#endif

	}
}
/*-----------------------------------------------------------*/

static portTASK_FUNCTION( vCompetingMathTask2, pvParameters )
{
volatile portDOUBLE d1, d2, d3, d4;
volatile unsigned portSHORT *pusTaskCheckVariable;
volatile portDOUBLE dAnswer;
portSHORT sError = pdFALSE;

	d1 = -389.38;
	d2 = 32498.2;
	d3 = -2.0001;

	dAnswer = ( d1 / d2 ) * d3;


	/* 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( ;; )
	{
		d1 = -389.38;
		d2 = 32498.2;
		d3 = -2.0001;

		d4 = ( d1 / d2 ) * d3;

		#if configUSE_PREEMPTION == 0
			taskYIELD();
		#endif
		
		/* If the calculation does not match the expected constant, stop the 
		increment of the check variable. */
		if( fabs( d4 - dAnswer ) > 0.001 )
		{
			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 )++;
		}

		#if configUSE_PREEMPTION == 0
			taskYIELD();
		#endif
	}
}
/*-----------------------------------------------------------*/

static portTASK_FUNCTION( vCompetingMathTask3, pvParameters )
{
volatile portDOUBLE *pdArray, dTotal1, dTotal2, dDifference;
volatile unsigned portSHORT *pusTaskCheckVariable;
const size_t xArraySize = 10;
size_t xPosition;
portSHORT sError = pdFALSE;

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

	pdArray = ( portDOUBLE * ) pvPortMalloc( xArraySize * sizeof( portDOUBLE ) );

	/* Keep filling an 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( ;; )
	{
		dTotal1 = 0.0;
		dTotal2 = 0.0;

		for( xPosition = 0; xPosition < xArraySize; xPosition++ )
		{
			pdArray[ xPosition ] = ( portDOUBLE ) xPosition + 5.5;
			dTotal1 += ( portDOUBLE ) xPosition + 5.5;	
		}

		#if configUSE_PREEMPTION == 0
			taskYIELD();
		#endif

		for( xPosition = 0; xPosition < xArraySize; xPosition++ )
		{
			dTotal2 += pdArray[ xPosition ];
		}

		dDifference = dTotal1 - dTotal2;
		if( fabs( dDifference ) > 0.001 )
		{
			sError = pdTRUE;
		}

		#if configUSE_PREEMPTION == 0
			taskYIELD();
		#endif

		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 portTASK_FUNCTION( vCompetingMathTask4, pvParameters )
{
volatile portDOUBLE *pdArray, dTotal1, dTotal2, dDifference;
volatile unsigned portSHORT *pusTaskCheckVariable;
const size_t xArraySize = 10;
size_t xPosition;
portSHORT sError = pdFALSE;

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

	pdArray = ( portDOUBLE * ) pvPortMalloc( xArraySize * sizeof( portDOUBLE ) );

	/* Keep filling an 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( ;; )
	{
		dTotal1 = 0.0;
		dTotal2 = 0.0;

		for( xPosition = 0; xPosition < xArraySize; xPosition++ )
		{
			pdArray[ xPosition ] = ( portDOUBLE ) xPosition * 12.123;
			dTotal1 += ( portDOUBLE ) xPosition * 12.123;	
		}

		#if configUSE_PREEMPTION == 0
			taskYIELD();
		#endif

		for( xPosition = 0; xPosition < xArraySize; xPosition++ )
		{
			dTotal2 += pdArray[ xPosition ];
		}

		dDifference = dTotal1 - dTotal2;
		if( fabs( dDifference ) > 0.001 )
		{
			sError = pdTRUE;
		}

		#if configUSE_PREEMPTION == 0
			taskYIELD();
		#endif

		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 xAreMathsTaskStillRunning( void )
{
/* Keep a history of the check variables so we know if they have been incremented 
since the last call. */
static unsigned portSHORT usLastTaskCheck[ mathNUMBER_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 < mathNUMBER_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一区二区三区免费野_久草精品视频
欧美大胆一级视频| 亚洲女厕所小便bbb| 色美美综合视频| 国产伦精品一区二区三区在线观看| 国产精品久久久久久久蜜臀| 日韩午夜在线影院| 欧洲视频一区二区| 成人高清视频在线| 国产又粗又猛又爽又黄91精品| 午夜不卡在线视频| 亚洲综合图片区| 综合久久一区二区三区| 国产亚洲精品免费| 日韩欧美国产电影| 欧美一区二区国产| 精品视频一区三区九区| 色诱亚洲精品久久久久久| 国产91丝袜在线观看| 国产尤物一区二区在线 | 免费精品99久久国产综合精品| 亚洲欧美日韩国产成人精品影院| 国产视频在线观看一区二区三区| 日韩精品一区二区三区四区 | 欧美日韩高清在线| 在线一区二区视频| 色先锋资源久久综合| 99久久精品国产导航| 成人午夜激情在线| 成人h动漫精品一区二区| 国产成人午夜精品影院观看视频| 久久国产尿小便嘘嘘| 免费人成网站在线观看欧美高清| 日日夜夜一区二区| 日日噜噜夜夜狠狠视频欧美人| 亚洲第一福利一区| 亚洲福利电影网| 日韩精品每日更新| 天天综合色天天| 开心九九激情九九欧美日韩精美视频电影 | 99久久精品国产观看| 99精品桃花视频在线观看| 97精品国产露脸对白| 91在线观看高清| 在线影院国内精品| 91精品中文字幕一区二区三区| 欧美理论电影在线| 日韩一区二区在线观看视频| 欧美一级黄色录像| 久久久久88色偷偷免费| 中文久久乱码一区二区| 日韩一区在线看| 亚洲一区二区三区四区五区黄| 亚洲猫色日本管| 亚洲成年人影院| 玖玖九九国产精品| 成人黄色在线网站| 91美女片黄在线观看91美女| 欧美日韩日日夜夜| 精品电影一区二区| 中文字幕在线观看一区二区| 亚洲精品成人少妇| 美女视频免费一区| 成人黄色大片在线观看| 欧美日韩一区小说| 日韩美女一区二区三区| 国产精品网站导航| 亚洲国产va精品久久久不卡综合| 麻豆国产精品官网| 99国产精品99久久久久久| 欧美综合亚洲图片综合区| 日韩视频免费观看高清在线视频| 久久久久88色偷偷免费| 亚洲宅男天堂在线观看无病毒| 日本v片在线高清不卡在线观看| 国产传媒久久文化传媒| 在线观看av一区二区| 久久影音资源网| 亚洲一线二线三线久久久| 久久丁香综合五月国产三级网站| 成人sese在线| 日韩一区二区在线观看视频| 亚洲天堂av一区| 久久国产精品露脸对白| 99这里都是精品| 欧美成人a在线| 亚洲精品国产无天堂网2021| 精品一区二区三区在线播放| 91猫先生在线| 久久一区二区三区四区| 亚洲国产日韩在线一区模特| 国产精品夜夜嗨| 欧美日韩视频专区在线播放| 国产精品网站在线播放| 久久国产综合精品| 欧美亚日韩国产aⅴ精品中极品| 久久精品免费在线观看| 亚洲成av人片在线| 91视频国产资源| 国产三级欧美三级日产三级99| 亚洲午夜久久久久久久久久久| 高清不卡在线观看| 欧美成人一区二区| 亚洲午夜电影在线| 99精品视频中文字幕| 国产亚洲成aⅴ人片在线观看| 天天亚洲美女在线视频| 日本高清视频一区二区| 国产女人18毛片水真多成人如厕| 热久久免费视频| 欧美三级电影在线看| 欧美激情一区不卡| 国产乱码精品一区二区三| 日韩视频在线观看一区二区| 亚洲超丰满肉感bbw| 欧洲av一区二区嗯嗯嗯啊| 国产精品国产三级国产专播品爱网 | 亚洲精品欧美激情| 99精品国产一区二区三区不卡| 久久精品人人做人人爽人人| 久久精品国产免费| 日韩无一区二区| 日日噜噜夜夜狠狠视频欧美人| 欧美视频完全免费看| 亚洲精品乱码久久久久久久久| 91在线小视频| 亚洲欧美在线aaa| av在线不卡免费看| 国产欧美一区二区精品仙草咪| 国产一区二区不卡在线| 久久久久久久综合色一本| 国产永久精品大片wwwapp| 精品久久久久99| 精品一区二区三区在线播放视频 | 欧美精选在线播放| 婷婷夜色潮精品综合在线| 欧美四级电影网| 午夜伊人狠狠久久| 91精品国产综合久久久久久久 | 日韩精品一级二级| 91精品国产综合久久久久久久| 日本一不卡视频| 精品久久久三级丝袜| 国产精品1区2区3区| 国产精品狼人久久影院观看方式| 成人一二三区视频| 亚洲四区在线观看| 欧美视频你懂的| 日本视频在线一区| 精品播放一区二区| 成人久久视频在线观看| 亚洲人成小说网站色在线| 欧美怡红院视频| 日精品一区二区三区| 2024国产精品视频| 成人av电影免费在线播放| 一区二区三区资源| 91麻豆精品国产91久久久使用方法 | 国产精品久久久久aaaa樱花| 99久久精品一区| 水蜜桃久久夜色精品一区的特点| 精品嫩草影院久久| 99久久er热在这里只有精品15| 一级特黄大欧美久久久| 欧美一级高清片| 成人av在线影院| 亚洲福利一二三区| 久久久久久免费| 欧美性色综合网| 国产在线一区二区| 亚洲精品欧美激情| 精品免费视频一区二区| 91麻豆免费视频| 久久国产精品无码网站| 自拍偷在线精品自拍偷无码专区| 777亚洲妇女| 99久久久久久99| 麻豆精品在线播放| 亚洲色图一区二区| 精品国产伦理网| 欧洲视频一区二区| 国产精品中文字幕欧美| 亚洲综合色成人| 欧美激情一区二区在线| 6080yy午夜一二三区久久| 国产+成+人+亚洲欧洲自线| 五月天亚洲精品| 综合色中文字幕| 久久亚洲精品小早川怜子| 欧美少妇一区二区| 顶级嫩模精品视频在线看| 水蜜桃久久夜色精品一区的特点| 中文字幕巨乱亚洲| 日韩免费看的电影| 欧美综合在线视频| av毛片久久久久**hd| 久久精品99久久久| 亚洲国产欧美在线人成| 亚洲欧洲日产国产综合网| 久久青草欧美一区二区三区| 欧美日韩www|