Pumpkin, Inc.

Pumpkin User Forums

Start a task at a specific location

For issues specific to Microchip's PICmicro® MCUs, including compilers (e.g. HI-TECH PICC & PICC-18, Microchip MPLAB®-C18) and IDEs (e.g. Microchip MPLAB®).

Start a task at a specific location

Postby Darukur » Mon Jun 26, 2006 6:57 am

I have a task with multiple labels and I want to know if it´s possible to start the task in a certain label inside the task.

Thanks in advance

------------------
the one that does not know what looks for does not understand what finds

the one that does not know what looks for does not understand what finds
Darukur
 
Posts: 12
Joined: Sun Jun 25, 2006 11:00 pm
Location: Mar del Plata, Buenos Aires, Argentina

Re: Start a task at a specific location

Postby Darukur » Mon Jun 26, 2006 7:08 am

It´s possible to use it like this?

OSCreateTask(label to position,pointer,prio);

were "label to position" is the specific location on the task

the one that does not know what looks for does not understand what finds
Darukur
 
Posts: 12
Joined: Sun Jun 25, 2006 11:00 pm
Location: Mar del Plata, Buenos Aires, Argentina

Re: Start a task at a specific location

Postby Darukur » Mon Jun 26, 2006 11:04 am

In order to work the last note I had to destroy the task and recreate it with the desired starting point.
Is this a correct thing to do?
the one that does not know what looks for does not understand what finds
Darukur
 
Posts: 12
Joined: Sun Jun 25, 2006 11:00 pm
Location: Mar del Plata, Buenos Aires, Argentina

Re: Start a task at a specific location

Postby aek » Tue Jun 27, 2006 7:17 am

Hmmm ... IIRC the current release (3.2.4 and higher) of Salvo allows you to re-create a task via OSCreateTask() without first destroying it ... check OSCreateTask()'s return code. Destroying it first is much safer. If the task is already waiting an event, then this won't work.

But yes, since Salvo tasks are void taskName (void), you should be able to "initially enter" the task just about anywhere. I haven't tried it, but I don't see why it wouldn't work. I'd recommend testing it thoroughly, though.

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

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

Re: Start a task at a specific location

Postby Darukur » Tue Jun 27, 2006 10:09 am

Thanks for your quick response.
the one that does not know what looks for does not understand what finds
Darukur
 
Posts: 12
Joined: Sun Jun 25, 2006 11:00 pm
Location: Mar del Plata, Buenos Aires, Argentina

Re: Start a task at a specific location

Postby Darukur » Wed Jun 28, 2006 5:34 am

In order to destroy the task...
Do I have to wait for the task to change its state to another than WAITING or I can force it to another state?
Maybe with "OSStopTask"?
the one that does not know what looks for does not understand what finds
Darukur
 
Posts: 12
Joined: Sun Jun 25, 2006 11:00 pm
Location: Mar del Plata, Buenos Aires, Argentina

Re: Start a task at a specific location

Postby aek » Wed Jun 28, 2006 10:14 am

Send an email to support and we'll send you the code for a function that will unconditionally kill a task, no matter what's state it's in.

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

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

Re: Start a task at a specific location

Postby Darukur » Thu Jun 29, 2006 5:36 am

I sent the email to info@pumpkininc.com

thanks.

the one that does not know what looks for does not understand what finds
Darukur
 
Posts: 12
Joined: Sun Jun 25, 2006 11:00 pm
Location: Mar del Plata, Buenos Aires, Argentina


Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 2 guests

cron