]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/WIN32-MSVC/main_full.c
Minor bug fix in NTPDemo.c -> use of FREERTOS_INVALID_SOCKET in place of NULL.
[freertos] / FreeRTOS / Demo / WIN32-MSVC / main_full.c
index b99ff8b8d433862f1af0f80b4b6c0dc342541e50..3a601fed041c1b9d5b58cce155f28bdcdf6afaf6 100644 (file)
@@ -1,6 +1,6 @@
 /*\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
@@ -46,7 +46,7 @@
  * 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
@@ -141,8 +141,8 @@ static void prvDemonstrateTaskStateAndHandleGetFunctions( void );
 static void prvDemonstratePendingFunctionCall( void );\r
 \r
 /*\r
-* The function that is pended by prvDemonstratePendingFunctionCall().\r
-*/\r
+ * The function that is pended by prvDemonstratePendingFunctionCall().\r
+ */\r
 static void prvPendedFunction( void *pvParameter1, uint32_t ulParameter2 );\r
 \r
 /*\r
@@ -204,10 +204,10 @@ int main_full( void )
        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( configSUPPORT_STATIC_ALLOCATION == 1 )\r
        {\r
@@ -244,7 +244,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
@@ -370,10 +371,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