/*\r
- * FreeRTOS Kernel V10.0.1\r
- * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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
* this software and associated documentation files (the "Software"), to deal in\r
* in main.c. This file implements the comprehensive test and demo version.\r
*\r
* NOTE 3: This file only contains the source code that is specific to the\r
- * basic demo. Generic functions, such FreeRTOS hook functions, are defined in\r
+ * full demo. Generic functions, such FreeRTOS hook functions, are defined in\r
* main.c.\r
*******************************************************************************\r
*\r
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
xTaskCreate( prvPermanentlyBlockingSemaphoreTask, "BlockSem", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
xTaskCreate( prvPermanentlyBlockingNotificationTask, "BlockNoti", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
\r
- vStartMessageBufferTasks();\r
+ vStartMessageBufferTasks( configMINIMAL_STACK_SIZE );\r
vStartStreamBufferTasks();\r
vStartStreamBufferInterruptDemo();\r
- vStartMessageBufferAMPTasks();\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
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
{\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
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
\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
/* 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