Pumpkin, Inc.

Pumpkin User Forums

Stopping a Task from within the same Task.

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

Stopping a Task from within the same Task.

Postby aek » Wed Jan 02, 2008 5:21 am

Greg.

You're on MSP430, right?

Update to the latest Salvo release and use OSDestroyTask() -- look at it in the source code and you'll see the new version kills a task completely. Also has a new syntax.

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

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

Re: Stopping a Task from within the same Task.

Postby gcarrelli » Wed Jan 02, 2008 7:10 am

Question: Can OSStopTask () be called from within the Task that is to be stopped or must it be done outside of that same Task?

Thanks.

gcarrelli
 
Posts: 10
Joined: Tue May 22, 2007 11:00 pm
Location: Cincinnati

Re: Stopping a Task from within the same Task.

Postby aek » Wed Jan 02, 2008 7:14 am

OS_Stop() is preferred.

Calling OSStopTask() "on itself" will only result in a stopped task if the first context switch to follow the OSStopTask() call is OS_Yield().

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

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

Re: Stopping a Task from within the same Task.

Postby gcarrelli » Wed Jan 02, 2008 8:44 am

I thought there was an issue with OSStop OSStopTask and you created a new one that unconditionally stopped the specified Task - that is the one I'm actually using - but it seems to not be affective like you said.
I need a definite STOP Task servive - unconditional - I can add OS_Yield in with the stop service if required....
Thanks.
gcarrelli
 
Posts: 10
Joined: Tue May 22, 2007 11:00 pm
Location: Cincinnati

Re: Stopping a Task from within the same Task.

Postby gcarrelli » Thu Jan 03, 2008 9:14 am

- Yes MSP430.
- I'm getting a better understanding of Stopping & Starting Tasks now. I think part of my problem was handeling Tasks based on OS_Delay( )- such as a timeout Task I made.
- It wasn't stopping when I used OSStopTask -after the OS_Delay time period - but I believe now that this was due to the lack (missing) OS_Yield () that is part of OS_Stop ().
Thanks.
gcarrelli
 
Posts: 10
Joined: Tue May 22, 2007 11:00 pm
Location: Cincinnati


Return to Coding

Who is online

Users browsing this forum: No registered users and 3 guests

cron