mirror of
				https://github.com/FreeRTOS/FreeRTOS-Kernel.git
				synced 2025-11-04 02:32:42 -05:00 
			
		
		
		
	Added optional inclusion of floating point tasks.
This commit is contained in:
		
							parent
							
								
									45fceb4bdd
								
							
						
					
					
						commit
						dc897a35dd
					
				
					 2 changed files with 43 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -74,6 +74,8 @@
 | 
			
		|||
#define configUSE_TRACE_FACILITY		0
 | 
			
		||||
#define configCHECK_FOR_STACK_OVERFLOW	2
 | 
			
		||||
#define configUSE_COUNTING_SEMAPHORES	1
 | 
			
		||||
#define configUSE_APPLICATION_TASK_TAG	0
 | 
			
		||||
#define configUSE_FPU					0
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/* Co-routine definitions. */
 | 
			
		||||
| 
						 | 
				
			
			@ -96,4 +98,13 @@ to exclude the API function. */
 | 
			
		|||
#define configUSE_RECURSIVE_MUTEXES		1
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#if configUSE_FPU == 1
 | 
			
		||||
	/* Include the header that define the traceTASK_SWITCHED_IN() and
 | 
			
		||||
	traceTASK_SWITCHED_OUT() macros to save and restore the floating
 | 
			
		||||
	point registers for tasks that have requested this behaviour. */
 | 
			
		||||
	#include "FPU_Macros.h"
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#endif /* FREERTOS_CONFIG_H */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -95,6 +95,8 @@
 | 
			
		|||
#include "partest.h"
 | 
			
		||||
#include "countsem.h"
 | 
			
		||||
#include "recmutex.h"
 | 
			
		||||
#include "flop.h"
 | 
			
		||||
#include "flop-reg-test.h"
 | 
			
		||||
 | 
			
		||||
/* Priorities assigned to the demo tasks. */
 | 
			
		||||
#define mainCHECK_TASK_PRIORITY			( tskIDLE_PRIORITY + 4 )
 | 
			
		||||
| 
						 | 
				
			
			@ -176,6 +178,24 @@ int main( void )
 | 
			
		|||
	vStartCountingSemaphoreTasks();
 | 
			
		||||
	vStartRecursiveMutexTasks();
 | 
			
		||||
 | 
			
		||||
	#if ( configUSE_FPU == 1 )
 | 
			
		||||
	{
 | 
			
		||||
		/* To use floating point:
 | 
			
		||||
			
 | 
			
		||||
			0) Add the files contained in the RTOSDemo/flop directory to the 
 | 
			
		||||
			   build.
 | 
			
		||||
			1) Your FPGA hardware design needs to add the APU FPU.  This should
 | 
			
		||||
			   then also make the compiler options change to include the option
 | 
			
		||||
			   -mfpu=sp_full, but best to check.
 | 
			
		||||
			2) Set configUSE_FPU to 1 in FreeRTOSConfig.h.
 | 
			
		||||
			3) Set configUSE_APPLICATION_TASK_TAG to 1 in FreeRTOSConfig.h.
 | 
			
		||||
			4) Ensure #include "FPU_Macros.h" is contained within 
 | 
			
		||||
			   FreeRTOSConfig.h (as per this example). */
 | 
			
		||||
		vStartMathTasks( mainFLOP_PRIORITY );
 | 
			
		||||
		vStartFlopRegTests();
 | 
			
		||||
	}
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	/* Create the tasks defined within this file. */
 | 
			
		||||
	xTaskCreate( prvRegTestTask1, "Regtest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
 | 
			
		||||
	xTaskCreate( prvRegTestTask2, "Regtest2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
 | 
			
		||||
| 
						 | 
				
			
			@ -264,6 +284,18 @@ static unsigned portLONG ulLastRegTest1Counter= 0UL, ulLastRegTest2Counter = 0UL
 | 
			
		|||
		lReturn = pdFAIL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	#if ( configUSE_FPU == 1 )
 | 
			
		||||
		if( xAreMathsTaskStillRunning() != pdTRUE )
 | 
			
		||||
		{
 | 
			
		||||
			lReturn = pdFAIL;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if( xAreFlopRegisterTestsStillRunning() != pdTRUE )
 | 
			
		||||
		{
 | 
			
		||||
			lReturn = pdFAIL;
 | 
			
		||||
		}
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	/* Have the register test tasks found any errors? */
 | 
			
		||||
	if( xRegTestStatus != pdPASS )
 | 
			
		||||
	{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue