diff --git a/FreeRTOS/Demo/WIN32-MSVC/FreeRTOSConfig.h b/FreeRTOS/Demo/WIN32-MSVC/FreeRTOSConfig.h index 4fc8265eaa..96f9704e8e 100644 --- a/FreeRTOS/Demo/WIN32-MSVC/FreeRTOSConfig.h +++ b/FreeRTOS/Demo/WIN32-MSVC/FreeRTOSConfig.h @@ -46,7 +46,7 @@ #define configUSE_DAEMON_TASK_STARTUP_HOOK 1 #define configTICK_RATE_HZ ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */ #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 70 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the win32 thread. */ -#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 52 * 1024 ) ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 52 * 1024 ) ) /* This demo tests heap_5 so places multiple blocks within this total heap size. See mainREGION_1_SIZE to mainREGION_3_SIZE definitions in main.c. */ #define configMAX_TASK_NAME_LEN ( 12 ) #define configUSE_TRACE_FACILITY 1 #define configUSE_16_BIT_TICKS 0 @@ -75,7 +75,8 @@ #define configMAX_PRIORITIES ( 7 ) /* Run time stats gathering configuration options. */ -unsigned long ulGetRunTimeCounterValue( void ); /* Prototype of function that returns run time counter. */ +#define configRUN_TIME_COUNTER_TYPE uint64_t +configRUN_TIME_COUNTER_TYPE ulGetRunTimeCounterValue( void ); /* Prototype of function that returns run time counter. */ void vConfigureTimerForRunTimeStats( void ); /* Prototype of function that initialises the run time counter. */ #define configGENERATE_RUN_TIME_STATS 1 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats() diff --git a/FreeRTOS/Demo/WIN32-MSVC/Run-time-stats-utils.c b/FreeRTOS/Demo/WIN32-MSVC/Run-time-stats-utils.c index 426b052541..59f398fd5d 100644 --- a/FreeRTOS/Demo/WIN32-MSVC/Run-time-stats-utils.c +++ b/FreeRTOS/Demo/WIN32-MSVC/Run-time-stats-utils.c @@ -71,10 +71,10 @@ LARGE_INTEGER liPerformanceCounterFrequency, liInitialRunTimeValue; } /*-----------------------------------------------------------*/ -unsigned long ulGetRunTimeCounterValue( void ) +configRUN_TIME_COUNTER_TYPE ulGetRunTimeCounterValue( void ) { LARGE_INTEGER liCurrentCount; -unsigned long ulReturn; +configRUN_TIME_COUNTER_TYPE ulReturn; /* What is the performance counter value now? */ QueryPerformanceCounter( &liCurrentCount ); @@ -90,7 +90,7 @@ unsigned long ulReturn; } else { - ulReturn = ( unsigned long ) ( ( liCurrentCount.QuadPart - llInitialRunTimeCounterValue ) / llTicksPerHundedthMillisecond ); + ulReturn = ( configRUN_TIME_COUNTER_TYPE ) ( ( liCurrentCount.QuadPart - llInitialRunTimeCounterValue ) / llTicksPerHundedthMillisecond ); } return ulReturn; diff --git a/FreeRTOS/Demo/WIN32-MSVC/main.c b/FreeRTOS/Demo/WIN32-MSVC/main.c index ba483ea5e3..7797a44245 100644 --- a/FreeRTOS/Demo/WIN32-MSVC/main.c +++ b/FreeRTOS/Demo/WIN32-MSVC/main.c @@ -70,7 +70,7 @@ The blinky demo is implemented and described in main_blinky.c. If mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is not 1 then the comprehensive test and demo application will be built. The comprehensive test and demo application is implemented and described in main_full.c. */ -#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 0 +#define mainCREATE_SIMPLE_BLINKY_DEMO_ONLY 1 /* This demo uses heap_5.c, and these constants define the sizes of the regions that make up the total heap. heap_5 is only used for test and example purposes @@ -78,7 +78,7 @@ as this demo could easily create one large heap region instead of multiple smaller heap regions - in which case heap_4.c would be the more appropriate choice. See http://www.freertos.org/a00111.html for an explanation. */ #define mainREGION_1_SIZE 8201 -#define mainREGION_2_SIZE 29905 +#define mainREGION_2_SIZE 31905 #define mainREGION_3_SIZE 7807 /*-----------------------------------------------------------*/ diff --git a/FreeRTOS/Demo/WIN32-MSVC/main_blinky.c b/FreeRTOS/Demo/WIN32-MSVC/main_blinky.c index ae2bba7d79..093ed457f4 100644 --- a/FreeRTOS/Demo/WIN32-MSVC/main_blinky.c +++ b/FreeRTOS/Demo/WIN32-MSVC/main_blinky.c @@ -245,7 +245,7 @@ uint32_t ulReceivedValue; console output) from a FreeRTOS task. */ if( ulReceivedValue == mainVALUE_SENT_FROM_TASK ) { - printf( "Message received from task\r\n" ); + printf( "Message received from task - idle time %llu%%\r\n", ulTaskGetIdleRunTimePercent() ); } else if( ulReceivedValue == mainVALUE_SENT_FROM_TIMER ) { diff --git a/FreeRTOS/Demo/WIN32-MSVC/main_full.c b/FreeRTOS/Demo/WIN32-MSVC/main_full.c index 052c967e37..3f17383e89 100644 --- a/FreeRTOS/Demo/WIN32-MSVC/main_full.c +++ b/FreeRTOS/Demo/WIN32-MSVC/main_full.c @@ -389,12 +389,13 @@ HeapStats_t xHeapStats; configASSERT( xHeapStats.xAvailableHeapSpaceInBytes == xPortGetFreeHeapSize() ); configASSERT( xHeapStats.xMinimumEverFreeBytesRemaining == xPortGetMinimumEverFreeHeapSize() ); - printf( "%s - tick count %zu - free heap %zu - min free heap %zu - largest free block %zu \r\n", + printf( "%s - tick count %zu - free heap %zu - min free heap %zu - largest free block %zu - idle time %llu%%\r\n", pcStatusMessage, xTaskGetTickCount(), xHeapStats.xAvailableHeapSpaceInBytes, xHeapStats.xMinimumEverFreeBytesRemaining, - xHeapStats.xSizeOfLargestFreeBlockInBytes ); + xHeapStats.xSizeOfLargestFreeBlockInBytes, + ulTaskGetIdleRunTimePercent() ); } } /*-----------------------------------------------------------*/ diff --git a/lexicon.txt b/lexicon.txt index ea9545c9ac..ae02dbea5a 100644 --- a/lexicon.txt +++ b/lexicon.txt @@ -2827,6 +2827,7 @@ ulstartingperiodms ulstatsoverflowcount ulstringlength ultaskendtrace +ultaskgetidleruntimepercent ultasknotifytake ultasknotifytakeindexed ultasknotifyvalueclearindexed