]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/WIN32-MSVC/main_full.c
Enable the Win32 comprehensive test/demo build and run when configUSE_QUEUE_SETS...
[freertos] / FreeRTOS / Demo / WIN32-MSVC / main_full.c
index e7ccb9c24c6a396999b35950affc4bb139051669..fddd40303bbf4b528daef36a5da5519ada688845 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
- * FreeRTOS Kernel V10.2.0\r
+ * FreeRTOS Kernel V10.2.1\r
  * Copyright (C) 2019 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
  *\r
  * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
@@ -193,11 +193,9 @@ int main_full( void )
        vStartRecursiveMutexTasks();\r
        vStartCountingSemaphoreTasks();\r
        vStartDynamicPriorityTasks();\r
-       vStartQueueSetTasks();\r
        vStartQueueOverwriteTask( mainQUEUE_OVERWRITE_PRIORITY );\r
        vStartEventGroupTasks();\r
        vStartInterruptSemaphoreTasks();\r
-       vStartQueueSetPollingTask();\r
        vCreateBlockTimeTasks();\r
        vCreateAbortDelayTasks();\r
        xTaskCreate( prvDemoQueueSpaceFunctions, "QSpace", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
@@ -209,6 +207,13 @@ int main_full( void )
        vStartStreamBufferInterruptDemo();\r
        vStartMessageBufferAMPTasks( configMINIMAL_STACK_SIZE );\r
 \r
+       #if( configUSE_QUEUE_SETS == 1 )\r
+       {\r
+               vStartQueueSetTasks();\r
+               vStartQueueSetPollingTask();\r
+       }\r
+       #endif\r
+\r
        #if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
        {\r
                vStartStaticallyAllocatedTasks();\r
@@ -244,7 +249,8 @@ int main_full( void )
 static void prvCheckTask( void *pvParameters )\r
 {\r
 TickType_t xNextWakeTime;\r
-const TickType_t xCycleFrequency = pdMS_TO_TICKS( 2500UL );\r
+const TickType_t xCycleFrequency = pdMS_TO_TICKS( 5000UL );\r
+HeapStats_t xHeapStats;\r
 \r
        /* Just to remove compiler warning. */\r
        ( void ) pvParameters;\r
@@ -332,18 +338,10 @@ const TickType_t xCycleFrequency = pdMS_TO_TICKS( 2500UL );
                {\r
                        pcStatusMessage = "Error: Dynamic";\r
                }\r
-               else if( xAreQueueSetTasksStillRunning() != pdPASS )\r
-               {\r
-                       pcStatusMessage = "Error: Queue set";\r
-               }\r
                else if( xIsQueueOverwriteTaskStillRunning() != pdPASS )\r
                {\r
                        pcStatusMessage = "Error: Queue overwrite";\r
                }\r
-               else if( xAreQueueSetPollTasksStillRunning() != pdPASS )\r
-               {\r
-                       pcStatusMessage = "Error: Queue set polling";\r
-               }\r
                else if( xAreBlockTimeTestTasksStillRunning() != pdPASS )\r
                {\r
                        pcStatusMessage = "Error: Block time";\r
@@ -361,6 +359,17 @@ const TickType_t xCycleFrequency = pdMS_TO_TICKS( 2500UL );
                        pcStatusMessage = "Error: Message buffer AMP";\r
                }\r
 \r
+               #if( configUSE_QUEUE_SETS == 1 )\r
+                       else if( xAreQueueSetTasksStillRunning() != pdPASS )\r
+                       {\r
+                               pcStatusMessage = "Error: Queue set";\r
+                       }\r
+                       else if( xAreQueueSetPollTasksStillRunning() != pdPASS )\r
+                       {\r
+                               pcStatusMessage = "Error: Queue set polling";\r
+                       }\r
+               #endif\r
+\r
                #if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
                        else if( xAreStaticAllocationTasksStillRunning() != pdPASS )\r
                        {\r
@@ -370,10 +379,17 @@ const TickType_t xCycleFrequency = pdMS_TO_TICKS( 2500UL );
 \r
                /* This is the only task that uses stdout so its ok to call printf()\r
                directly. */\r
-               printf( "%s - tick count %zu - free heap %zu - min free heap %zu\r\n", pcStatusMessage,\r
-                                                                                                                                                          xTaskGetTickCount(),\r
-                                                                                                                                                          xPortGetFreeHeapSize(),\r
-                                                                                                                                                          xPortGetMinimumEverFreeHeapSize() );\r
+               vPortGetHeapStats( &xHeapStats );\r
+\r
+               configASSERT( xHeapStats.xAvailableHeapSpaceInBytes == xPortGetFreeHeapSize() );\r
+               configASSERT( xHeapStats.xMinimumEverFreeBytesRemaining == xPortGetMinimumEverFreeHeapSize() );\r
+\r
+               printf( "%s - tick count %zu - free heap %zu - min free heap %zu - largest free block %zu \r\n",\r
+                       pcStatusMessage,\r
+                       xTaskGetTickCount(),\r
+                       xHeapStats.xAvailableHeapSpaceInBytes,\r
+                       xHeapStats.xMinimumEverFreeBytesRemaining,\r
+                       xHeapStats.xSizeOfLargestFreeBlockInBytes );\r
        }\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -463,10 +479,14 @@ TaskHandle_t xTimerTask;
        /* Call the periodic queue overwrite from ISR demo. */\r
        vQueueOverwritePeriodicISRDemo();\r
 \r
-       /* Write to a queue that is in use as part of the queue set demo to\r
-       demonstrate using queue sets from an ISR. */\r
-       vQueueSetAccessQueueSetFromISR();\r
-       vQueueSetPollingInterruptAccess();\r
+       #if( configUSE_QUEUE_SETS == 1 ) /* Remove the tests if queue sets are not defined. */\r
+       {\r
+               /* Write to a queue that is in use as part of the queue set demo to\r
+               demonstrate using queue sets from an ISR. */\r
+               vQueueSetAccessQueueSetFromISR();\r
+               vQueueSetPollingInterruptAccess();\r
+       }\r
+       #endif\r
 \r
        /* Exercise event groups from interrupts. */\r
        vPeriodicEventGroupsProcessing();\r