Page 1 of 1

OSCreateTask & OSStartTask ??

PostPosted: Fri Mar 31, 2006 10:32 am
by seulater
I am cornfused about OSCreateTask & OSStartTask. I know what the differences are, but all I have to do is use OSCreateTask and my tasks run. shouldn't I also have to call OSStartTask to start that task ?

What if I want to create 2 tasks. have the first one running,and the second one idle or dormant. if a certain event happened that I needed the second task to run I would call OSStartTask for the second task.

How is this accomplished ?


Re: OSCreateTask & OSStartTask ??

PostPosted: Fri Mar 31, 2006 10:40 am
by aek
Yep, you've got it right.

A task will start automatically just by creating it with OSCreateTask(). If it doesn't start, then you need to check OSCreateTask()'s return code (should be 0) or figure out what else you did wrong (e.g. too low a priority and higher-priority tasks are always running).

Use OSDONT_START if you want to create a task and start it later via OSStartTask().

See the User Manual for more info on OSCreateTask().

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

[This message has been edited by aek (edited March 31, 2006).]


Re: OSCreateTask & OSStartTask ??

PostPosted: Fri Mar 31, 2006 10:50 am
by seulater
how did I miss that in the manual

Thanks!


Re: OSCreateTask & OSStartTask ??

PostPosted: Fri Mar 31, 2006 11:05 am
by seulater
i added the OSDONT_START_TASK to my OSCreateTask and it worked as planned.

However when i later added OSStartTask i get a compile error of "undefined reference to `OSStartTask'"

I did not see anything in the manual that said i need to include somthing but i will look again.


Re: OSCreateTask & OSStartTask ??

PostPosted: Fri Mar 31, 2006 11:37 am
by seulater
I got it, i had to import salvotask.c