Page 1 of 1

Passing variables to Tasks

PostPosted: Fri Feb 20, 2009 12:12 pm
by garrett
Can you pass a variable to a task in
the parameter line? I did not see
anything explicit in the manual that
says yes or no...

Such as this:
MyTask(int delaytime)
{

while (1)
{
OSDelay(delaytime);

}


Thanks!


Re: Passing variables to Tasks

PostPosted: Fri Feb 20, 2009 12:20 pm
by aek
Salvo tasks do not accept parameters and do not return values.

However, Salvo Pro users can enable tcb extensions, which can be used in a manner that somewhat emulates parameter passing to tasks.

Also note that arguments to Salvo services (e.g. OS_Delay()) can be variables, e.g.

code:
OS_Delay(delay_variable);

------------------