]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/WIN32-MingW/main_full.c
Update version number in readiness for V10.3.0 release. Sync SVN with reviewed releas...
[freertos] / FreeRTOS / Demo / WIN32-MingW / main_full.c
index abd9bf503904138c153d3d108517d9cde6caa412..e24aacb474aa47b86c62a0cabc9e20c33d1067ec 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
- * FreeRTOS Kernel V10.1.1\r
- * Copyright (C) 2018 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
+ * FreeRTOS Kernel V10.3.0\r
+ * Copyright (C) 2020 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
@@ -173,7 +173,7 @@ static void prvPermanentlyBlockingNotificationTask( void *pvParameters );
 \r
 /*\r
  * The test function and callback function used when exercising the timer AP\r
- * function that changes the timer's autoreload mode.\r
+ * function that changes the timer's auto-reload mode.\r
  */\r
 static void prvDemonstrateChangingTimerReloadMode( void *pvParameters );\r
 static void prvReloadModeTestTimerCallback( TimerHandle_t xTimer );\r
@@ -260,6 +260,7 @@ static void prvCheckTask( void *pvParameters )
 {\r
 TickType_t xNextWakeTime;\r
 const TickType_t xCycleFrequency = pdMS_TO_TICKS( 2500UL );\r
+HeapStats_t xHeapStats;\r
 \r
        /* Just to remove compiler warning. */\r
        ( void ) pvParameters;\r
@@ -385,10 +386,19 @@ 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 %u - free heap %u - min free heap %u\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 %u - free heap %u - min free heap %u - largest free block %u - number of free blocks %u\r\n",\r
+                                       pcStatusMessage,\r
+                                       xTaskGetTickCount(),\r
+                                       xHeapStats.xAvailableHeapSpaceInBytes,\r
+                                       xHeapStats.xMinimumEverFreeBytesRemaining,\r
+                                       xHeapStats.xSizeOfLargestFreeBlockInBytes,\r
+                                       xHeapStats.xNumberOfFreeBlocks );\r
+\r
                fflush( stdout );\r
        }\r
 }\r
@@ -617,8 +627,8 @@ static portBASE_TYPE xPerformedOneShotTests = pdFALSE;
 TaskHandle_t xTestTask;\r
 TaskStatus_t xTaskInfo;\r
 extern StackType_t uxTimerTaskStack[];\r
-static TickType_t xLastIdleExecutionTime = 0;\r
-TickType_t xIdleExecutionTime;\r
+static uint32_t ulLastIdleExecutionTime = 0;\r
+uint32_t ulIdleExecutionTime;\r
 \r
        /* Demonstrate the use of the xTimerGetTimerDaemonTaskHandle() and\r
        xTaskGetIdleTaskHandle() functions.  Also try using the function that sets\r
@@ -718,12 +728,12 @@ TickType_t xIdleExecutionTime;
                }\r
        }\r
 \r
-       xIdleExecutionTime = xTaskGetIdleRunTimeCounter();\r
-       if( xIdleExecutionTime == xLastIdleExecutionTime )\r
+       ulIdleExecutionTime = ulTaskGetIdleRunTimeCounter();\r
+       if( ulIdleExecutionTime == ulLastIdleExecutionTime )\r
        {\r
                pcStatusMessage = "Error: Total amount of Idle task execution time did not change";\r
        }\r
-       xLastIdleExecutionTime = xIdleExecutionTime;\r
+       ulLastIdleExecutionTime = ulIdleExecutionTime;\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
@@ -856,7 +866,7 @@ const TickType_t x100ms = pdMS_TO_TICKS( 100UL );
 \r
        xTimer = xTimerCreate(  pcTimerName,\r
                                                        x100ms,\r
-                                                       pdFALSE, /* Created as a one shot timer. */\r
+                                                       pdFALSE, /* Created as a one-shot timer. */\r
                                                        0,\r
                                                        prvReloadModeTestTimerCallback );\r
        configASSERT( xTimer );\r
@@ -865,7 +875,7 @@ const TickType_t x100ms = pdMS_TO_TICKS( 100UL );
        configASSERT( strcmp( pcTimerName, pcTimerGetName( xTimer ) ) == 0 );\r
        configASSERT( xTimerGetPeriod( xTimer ) == x100ms );\r
 \r
-       /* Timer was created as a one shot timer.  Its callback just increments the\r
+       /* Timer was created as a one-shot timer.  Its callback just increments the\r
        timer's ID - so set the ID to 0, let the timer run for a number of timeout\r
        periods, then check the timer has only executed once. */\r
        vTimerSetTimerID( xTimer, ( void * ) 0 );\r
@@ -873,7 +883,7 @@ const TickType_t x100ms = pdMS_TO_TICKS( 100UL );
        vTaskDelay( 3UL * x100ms );\r
        configASSERT( ( ( uint32_t ) ( pvTimerGetTimerID( xTimer ) ) ) == 1UL );\r
 \r
-       /* Now change the timer to be an autoreload timer and check it executes\r
+       /* Now change the timer to be an auto-reload timer and check it executes\r
        the expected number of times. */\r
        vTimerSetReloadMode( xTimer, pdTRUE );\r
        vTimerSetTimerID( xTimer, ( void * ) 0 );\r
@@ -882,7 +892,7 @@ const TickType_t x100ms = pdMS_TO_TICKS( 100UL );
        configASSERT( ( uint32_t ) ( pvTimerGetTimerID( xTimer ) ) == 3UL );\r
        configASSERT( xTimerStop( xTimer, 0 ) != pdFAIL );\r
 \r
-       /* Now change the timer back to be a one shot timer and check it only\r
+       /* Now change the timer back to be a one-shot timer and check it only\r
        executes once. */\r
        vTimerSetReloadMode( xTimer, pdFALSE );\r
        vTimerSetTimerID( xTimer, ( void * ) 0 );\r