Pumpkin, Inc.

Pumpkin User Forums

Passing variables to Tasks

If you can't make Salvo do what you want it to do, post it here.

Passing variables to Tasks

Postby garrett » Fri Feb 20, 2009 12:12 pm

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!

garrett
 
Posts: 8
Joined: Tue Oct 21, 2008 11:00 pm
Location: Cranberry Township PA USA

Re: Passing variables to Tasks

Postby aek » Fri Feb 20, 2009 12:20 pm

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);

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

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to Coding

Who is online

Users browsing this forum: No registered users and 2 guests

cron