]> git.sur5r.net Git - freertos/commitdiff
Added optional inclusion of floating point tasks.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sun, 11 May 2008 13:19:05 +0000 (13:19 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sun, 11 May 2008 13:19:05 +0000 (13:19 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@346 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/FreeRTOSConfig.h
Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/main.c

index 42fc96bd6a84be2fac1056e52f8fd806004089a3..1f5ef7902428a33b4ed8c52044daaa7b0df1b863 100644 (file)
@@ -74,6 +74,8 @@
 #define configUSE_TRACE_FACILITY               0\r
 #define configCHECK_FOR_STACK_OVERFLOW 2\r
 #define configUSE_COUNTING_SEMAPHORES  1\r
+#define configUSE_APPLICATION_TASK_TAG 0\r
+#define configUSE_FPU                                  0\r
 \r
 \r
 /* Co-routine definitions. */\r
@@ -96,4 +98,13 @@ to exclude the API function. */
 #define configUSE_RECURSIVE_MUTEXES            1\r
 \r
 \r
+#if configUSE_FPU == 1\r
+       /* Include the header that define the traceTASK_SWITCHED_IN() and\r
+       traceTASK_SWITCHED_OUT() macros to save and restore the floating\r
+       point registers for tasks that have requested this behaviour. */\r
+       #include "FPU_Macros.h"\r
+#endif\r
+\r
 #endif /* FREERTOS_CONFIG_H */\r
+\r
+\r
index 3e6b8eaad09d42ec2339298c0e2f1c26a0b269a6..6e4e3162125a65fde16b52313d9779a85e44d397 100644 (file)
@@ -95,6 +95,8 @@
 #include "partest.h"\r
 #include "countsem.h"\r
 #include "recmutex.h"\r
+#include "flop.h"\r
+#include "flop-reg-test.h"\r
 \r
 /* Priorities assigned to the demo tasks. */\r
 #define mainCHECK_TASK_PRIORITY                        ( tskIDLE_PRIORITY + 4 )\r
@@ -176,6 +178,24 @@ int main( void )
        vStartCountingSemaphoreTasks();\r
        vStartRecursiveMutexTasks();\r
 \r
+       #if ( configUSE_FPU == 1 )\r
+       {\r
+               /* To use floating point:\r
+                       \r
+                       0) Add the files contained in the RTOSDemo/flop directory to the \r
+                          build.\r
+                       1) Your FPGA hardware design needs to add the APU FPU.  This should\r
+                          then also make the compiler options change to include the option\r
+                          -mfpu=sp_full, but best to check.\r
+                       2) Set configUSE_FPU to 1 in FreeRTOSConfig.h.\r
+                       3) Set configUSE_APPLICATION_TASK_TAG to 1 in FreeRTOSConfig.h.\r
+                       4) Ensure #include "FPU_Macros.h" is contained within \r
+                          FreeRTOSConfig.h (as per this example). */\r
+               vStartMathTasks( mainFLOP_PRIORITY );\r
+               vStartFlopRegTests();\r
+       }\r
+       #endif\r
+\r
        /* Create the tasks defined within this file. */\r
        xTaskCreate( prvRegTestTask1, "Regtest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
        xTaskCreate( prvRegTestTask2, "Regtest2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
@@ -264,6 +284,18 @@ static unsigned portLONG ulLastRegTest1Counter= 0UL, ulLastRegTest2Counter = 0UL
                lReturn = pdFAIL;\r
        }\r
 \r
+       #if ( configUSE_FPU == 1 )\r
+               if( xAreMathsTaskStillRunning() != pdTRUE )\r
+               {\r
+                       lReturn = pdFAIL;\r
+               }\r
+\r
+               if( xAreFlopRegisterTestsStillRunning() != pdTRUE )\r
+               {\r
+                       lReturn = pdFAIL;\r
+               }\r
+       #endif\r
+\r
        /* Have the register test tasks found any errors? */\r
        if( xRegTestStatus != pdPASS )\r
        {\r