]> 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 312d044a98d7a2ac98320a3a7856ce65fe7c1fc5..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
@@ -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