Once-only actions in Task

billdenbeste wrote on Sunday, April 16, 2006:

I am having a good time implementing various experiements in FreeRTOS on a Silabs C8051F120.  I had no difficulty settinig up the Silabs IDE to work with the SDCC compiler.  I love having a good hardware debugger!  If anyone is having trouble with that setup, I might be able to help you out.

I have several tasks which must perform once-only actions prior to entering the for-ever loop.  Can I assume that the FreeRTOS web page which describes task structure as:

    void vATaskFunction( void *pvParameters )
    {
        for( ;; )
        {
            – Task application code here. –
        }
    }

could correctly be modified to:

    void vATaskFunction( void *pvParameters )
    {
        – Once-only code here. –
        for( ;; )
        {
            – Task application code here. –
        }
    }

I can tell you that this works correctly in all of the cases I have tried so far.  I would like to know if if is Kosher before implementing my final application.

Thanks.
- Bill Den Beste

rtel wrote on Sunday, April 16, 2006:

There is no problem with your suggestion for placing code prior to the for(;:wink: loop when implementing a task - note however it would not be ok to do this when implementing a co-routine.

Regards.