Timer functions are missing from timers.c

doini-2012 wrote on Tuesday, October 30, 2012:

Hello,
I am using FreeRTOS in my project, and I would like to use the timer functions. But I noticed that the timers.c file does not have all the timer functions.
Functions such as xTimerStart(), xTimerStop(), xTimerChangePeriod(), xTimerDelete(), xTimerReset() are missing.
I downloaded again the FreeRTOS files, but still the timers.c file does not have those functions.

Would you like to give me some advice?
I would really appreciate your help.

Thank you,
Doini

rtel wrote on Tuesday, October 30, 2012:

To use those functions you have to include FreeRTOS.h, then timers.h, and then you will be able to compile and link code with those functions.  They are actually macros in timers.h that call generic functions in timers.c.

Regards.

doini-2012 wrote on Wednesday, October 31, 2012:

Hello,

Thank you very much, that answers my question.

I included FreeRTOS.h, then timers.h in my project, and now it will recognize definitions (like xTimerHandle) from timers.h, but I have another problem:

I defined configUSE_TIMERS, but still everything after   #if ( configUSE_TIMERS == 1 )  is grey in timers.c, as it did not recognize the fact that I defined configUSE_TIMERS. In fact I defined the following in FreeRTOSConfig.h:

#define configMINIMAL_STACK_SIZE         ( ( unsigned short ) 128 )
#define configUSE_TIMERS                         1
#define configTIMER_TASK_PRIORITY       3
#define configTIMER_QUEUE_LENGTH      5
#define configTIMER_TASK_STACK_DEPTH    (configMINIMAL_STACK_SIZE * 4)

I would really appreciate your help.

Thank you,
Doini

edwards3 wrote on Wednesday, October 31, 2012:

You said it recognizes the definitions, so everything is ok. The editor might show them as being grayed out, but editors often get that wrong, especially if the editor is based on Eclipse.

doini-2012 wrote on Wednesday, October 31, 2012:

Yes, my editor is based on Eclipse.
I’ll see if I’ll have further issues.

Thank you very much, I appreciate your answer.
Doini

xz8987f wrote on Thursday, November 01, 2012:

Hello,
Although not FreeRTOS related at all:
The Eclipse editor used the Indexer for that kind of source coloring. I have seen many Eclipse distributions having the ‘Heuristic’ settings enabled, which can lead to wrong coloring. Switching that setting off helped for me, and it always fixed the problem for me.
See http://mcuoneclipse.com/2012/03/20/fixing-the-eclipse-index/

Erich

davedoors wrote on Thursday, November 01, 2012:

Staying off topic for a moment, as you seem to be an Eclipse expert, is there a way of making Eclipse remember your workspace settings so they are the default settings when you create a new workspace?

xz8987f wrote on Thursday, November 01, 2012:

Yes, there is. See http://mcuoneclipse.com/2012/04/06/eclipse-global-preferences/
And too keep these kind of questions out of this email list: simply post a comment on http://mcuoneclipse.com and I see if I can help from there.

Erich

doini-2012 wrote on Thursday, November 01, 2012:

Hello Erich,

I applied your advice and it worked.
Thank you,

Doini