Pumpkin, Inc.

Pumpkin User Forums

start and stop task

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 and stop task

Postby kamyip » Thu May 13, 2004 1:19 am

Hi again,

Something that I need to ascertain:

Say I have 2 tasks;

Task1() and Task2() both of priority 10 running in ring robbin.

Both Task1 and Task2 has OS_Delay in it.

Task1 is running and upon reaching OS_Delay, it pass the buck to Task2 to run. In Task2 under some condition a stoptask1 command is issued thus stopping task1 and runs all by itself.

On another condition, task2 will issue a starttask1 command and on OS_Delay it will pass the buck to Task1 to run.

Question:
Will task1 pick-up from its OS_Delay position or does it start all over again?

regards ... :-)

kamyip
 
Posts: 46
Joined: Mon Apr 15, 2002 11:00 pm

Re: start and stop task

Postby aek » Thu May 13, 2004 10:52 am

quote:
Will task1 pick-up from its OS_Delay position or does it start all over again?
It will pick up where it left off, i.e. immediately after OS_Delay().

To start a task all over again after stopping it, you'd need to call OSCreateTask().

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

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


Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 3 guests

cron