FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [October 2011 Threads] Run time stats conditional compilationPosted by jvalenzuela on October 14, 2011 Just getting FreeRTOS running for the first time and I came across what appears to be a simple problem. If configGENERATE_RUN_TIME_STATS is defined as zero should the call to portCONFIGURE_TIMER_FOR_RUN_TIME_STATS in vTaskStartScheduler be excluded from the build?
Jason Valenzuela
RE: Run time stats conditional compilationPosted by Richard on October 15, 2011 If configGENERATE_RUN_TIME_STATS is set to one then portCONFIGURE_TIMER_FOR_RUN_TIME_STATS and ( portGET_RUN_TIME_COUNTER_VALUE or portGET_ALT_RUN_TIME_COUNTER_VALUE ) must also be defined. If configGENERATE_RUN_TIME_STATS is set to 0, then the other two macros should not also be defined, although defining them is probably harmless. The code contains the following sanity check: #if ( configGENERATE_RUN_TIME_STATS == 1 )
#ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS #error If configGENERATE_RUN_TIME_STATS is defined then portCONFIGURE_TIMER_FOR_RUN_TIME_STATS must also be defined. portCONFIGURE_TIMER_FOR_RUN_TIME_STATS should call a port layer function to setup a peripheral timer/counter that can then be used as the run time counter time base. #endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */
#ifndef portGET_RUN_TIME_COUNTER_VALUE #ifndef portALT_GET_RUN_TIME_COUNTER_VALUE #error If configGENERATE_RUN_TIME_STATS is defined then either portGET_RUN_TIME_COUNTER_VALUE or portALT_GET_RUN_TIME_COUNTER_VALUE must also be defined. See the examples provided and the FreeRTOS web site for more information. #endif /* portALT_GET_RUN_TIME_COUNTER_VALUE */ #endif /* portGET_RUN_TIME_COUNTER_VALUE */
#endif /* configGENERATE_RUN_TIME_STATS */
Regards.
RE: Run time stats conditional compilationPosted by jvalenzuela on October 17, 2011 Understood. My question stemmed from line 1133 in task.c, which calls portCONFIGURE_TIMER_FOR_RUN_TIME_STATS regardless of the configGENERATE_RUN_TIME_STATS value. This of course fails when configGENERATE_RUN_TIME_STATS is defined to 0 and portCONFIGURE_TIMER_FOR_RUN_TIME_STATS is not defined. I was wondering if the call should be enclosed in an appropriate #ifdef block.
Jason Valenzuela
RE: Run time stats conditional compilationPosted by MEdwards on October 17, 2011 No #ifdef block is needed. In freertos.h you will find the code below that removes the macro if it is not defined #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() #endif
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|