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] [May 2011 Threads] Patch for missing #if in tasks.cPosted by Philip Munts on May 30, 2011 tasks.c is missing #if ( configGENERATE_RUN_TIME_STATS == 1 ) bracketing the call to portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() at line 1122.
--- tasks.c(revision 2690) +++ tasks.c(revision 2692) @@ -1116,11 +1116,13 @@ xSchedulerRunning = pdTRUE; xTickCount = ( portTickType ) 0; + #if ( configGENERATE_RUN_TIME_STATS == 1 ) /* If configGENERATE_RUN_TIME_STATS is defined then the following macro must be defined to configure the timer/counter used to generate the run time counter time base. */ portCONFIGURE_TIMER_FOR_RUN_TIME_STATS(); - +#endif + /* Setting up the timer tick is hardware specific and thus in the portable interface. */ if( xPortStartScheduler() )
RE: Patch for missing #if in tasks.cPosted by Richard on May 30, 2011 I don't understand this patch and can only assume you are using an old version of FreeRTOS or have modified the code yourself. If an #endif was missing, nothing would compile, surely? The code between lines 1104 and 1135 looks like this, there are no conditional compilations. if( xReturn == pdPASS ) { /* Interrupts are turned off here, to ensure a tick does not occur before or during the call to xPortStartScheduler(). The stacks of the created tasks contain a status word with interrupts switched on so interrupts will automatically get re-enabled when the first task starts to run.
STEPPING THROUGH HERE USING A DEBUGGER CAN CAUSE BIG PROBLEMS IF THE DEBUGGER ALLOWS INTERRUPTS TO BE PROCESSED. */ portDISABLE_INTERRUPTS();
xSchedulerRunning = pdTRUE; xTickCount = ( portTickType ) 0;
/* If configGENERATE_RUN_TIME_STATS is defined then the following macro must be defined to configure the timer/counter used to generate the run time counter time base. */ portCONFIGURE_TIMER_FOR_RUN_TIME_STATS();
/* Setting up the timer tick is hardware specific and thus in the portable interface. */ if( xPortStartScheduler() ) { /* Should not reach here as if the scheduler is running the function will not return. */ } else { /* Should only reach here if a task calls xTaskEndScheduler(). */ } } regards.
RE: Patch for missing #if in tasks.cPosted by Philip Munts on May 30, 2011 I am using 7.0.1. It is the added #if that is the key thing, not a missing #endif. You should not try to call portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() (which is at tasks.c line 1122) if configGENERATE_RUN_TIME_STATS is not defined. Of course, defining portCONFIGURE_TIMER_FOR_RUN_TIME_STATS as a null macro in FreeRTOSConfig.h works just as well, but it seems cleaner to me not to try to call it in the first place.
RE: Patch for missing #if in tasks.cPosted by Dave on May 30, 2011 If portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() is not defined then it will get automatically removed by code in FreeRTOS.h #ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() #endif If you have a problem compiling then it is likely the header files are not included in the correct order, although it should not be a problem compiling tasks.c. Have you made any changes to the code?
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|