Pumpkin, Inc.

Pumpkin User Forums

OSCreateTask & OSStartTask ??

If you have a general question or comment regarding Salvo, post it here.

OSCreateTask & OSStartTask ??

Postby seulater » Fri Mar 31, 2006 10:32 am

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 ?

seulater
 
Posts: 24
Joined: Tue May 10, 2005 11:00 pm
Location: Buffalo Grove, IL, USA

Re: OSCreateTask & OSStartTask ??

Postby aek » Fri Mar 31, 2006 10:40 am

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).]

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

Re: OSCreateTask & OSStartTask ??

Postby seulater » Fri Mar 31, 2006 10:50 am

how did I miss that in the manual

Thanks!

seulater
 
Posts: 24
Joined: Tue May 10, 2005 11:00 pm
Location: Buffalo Grove, IL, USA

Re: OSCreateTask & OSStartTask ??

Postby seulater » Fri Mar 31, 2006 11:05 am

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.

seulater
 
Posts: 24
Joined: Tue May 10, 2005 11:00 pm
Location: Buffalo Grove, IL, USA

Re: OSCreateTask & OSStartTask ??

Postby seulater » Fri Mar 31, 2006 11:37 am

I got it, i had to import salvotask.c
seulater
 
Posts: 24
Joined: Tue May 10, 2005 11:00 pm
Location: Buffalo Grove, IL, USA


Return to General

Who is online

Users browsing this forum: No registered users and 2 guests

cron