]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/CORTEX_M4_ATSAM4E_Atmel_Studio/src/main_full.c
Add event groups demo to SAM4E demo.
[freertos] / FreeRTOS / Demo / CORTEX_M4_ATSAM4E_Atmel_Studio / src / main_full.c
index cf39d8fef6bfb5a831e1d0b45527f86091f90b05..1f4840c00aa38f74bb88a91f03eef7fa71ac4e9b 100644 (file)
 #include "QueueOverwrite.h"\r
 #include "QueueSet.h"\r
 #include "recmutex.h"\r
+#include "EventGroupsDemo.h"\r
 \r
 /* The period after which the check timer will expire, in ms, provided no errors\r
 have been reported by any of the standard demo tasks.  ms are converted to the\r
@@ -178,10 +179,11 @@ http://www.FreeRTOS.org/udp */
 #define mainCONNECTED_IP_TASK_PRIORITY         ( configMAX_PRIORITIES - 1 )\r
 #define mainDISCONNECTED_IP_TASK_PRIORITY      ( tskIDLE_PRIORITY )\r
 \r
-/* UDP command server task parameters. */\r
+/* UDP command server and echo task parameters. */\r
 #define mainUDP_CLI_TASK_PRIORITY                      ( tskIDLE_PRIORITY )\r
 #define mainUDP_CLI_PORT_NUMBER                                ( 5001UL )\r
 #define mainUDP_CLI_TASK_STACK_SIZE                    ( configMINIMAL_STACK_SIZE * 2U )\r
+#define mainECHO_CLIENT_STACK_SIZE                     ( configMINIMAL_STACK_SIZE + 30 )\r
 \r
 /* Set to 1 to include the UDP echo client tasks in the build.  The echo clients\r
 require the IP address of the echo server to be defined using the\r
@@ -293,6 +295,7 @@ TimerHandle_t xTimer = NULL;
        vStartQueueOverwriteTask( mainQUEUE_OVERWRITE_TASK_PRIORITY );\r
        vStartQueueSetTasks();\r
        vStartRecursiveMutexTasks();\r
+       vStartEventGroupTasks();\r
 \r
        /* Create the software timer that performs the 'check' functionality, as\r
        described at the top of this file. */\r
@@ -365,6 +368,10 @@ unsigned long ulErrorOccurred = pdFALSE;
        {\r
                ulErrorOccurred |= ( 0x01UL << 12UL );\r
        }\r
+       else if( xAreEventGroupTasksStillRunning() != pdTRUE )\r
+       {\r
+               ulErrorOccurred |= ( 0x01UL << 13UL );\r
+       }\r
 \r
        if( ulErrorOccurred != pdFALSE )\r
        {\r
@@ -422,7 +429,7 @@ char cIPAddress[ 20 ];
                                address of the echo server to be defined using the\r
                                configECHO_SERVER_ADDR0 to configECHO_SERVER_ADDR3 constants in\r
                                FreeRTOSConfig.h. */\r
-                               vStartEchoClientTasks( configMINIMAL_STACK_SIZE, tskIDLE_PRIORITY );\r
+                               vStartEchoClientTasks( mainECHO_CLIENT_STACK_SIZE, tskIDLE_PRIORITY );\r
                        }\r
                        #endif\r
                }\r
@@ -487,6 +494,9 @@ void vFullDemoTickHook( void )
 \r
        /* Call the periodic queue set ISR test function. */\r
        vQueueSetAccessQueueSetFromISR();\r
+       \r
+       /* Call the event group ISR tests. */\r
+       vPeriodicEventGroupsProcessing();\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r