Page 1 of 1

OSStopTask

PostPosted: Sun Jan 11, 2009 4:29 am
by Bummibaer
Hello,

I don't understand the
OSStopTask-Call
According to Chapter 2 Task States ,• RTOS Fundamentals
in the Documentation, the Call is only
valid in the RUNNING-Mode.

My code gives OSERR:

code:
for(; {
OS_WaitMsgQ(MSGQ_ECB_CHDATA, (OStypeMsgPP)&sensordata_p, gtimeout);
if ( system_state.opmode == OM_IDLE ){
OStypeErr rc = OSStopTask(TASK_SENSOR_P);
}
...
}

Two hints:
OSTCB_TASK_RUNNING is not used, why?
In
OSDelTaskQ
the global variable OSeligQP
is null.

Any Ideas?

Steffen


Re: OSStopTask

PostPosted: Sun Jan 11, 2009 9:34 am
by aek
Use OS_StopTask() to stop the current task.

Use OSStopTask() to stop a particular task -- not the current one -- and one that is in a state that OSStopTask() can stop.

The error code will give you more insight as to why the API call failed.

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


Re: OSStopTask

PostPosted: Mon Jan 12, 2009 10:40 am
by aek
See http://www.pumpkininc.com/content/doc/manual/SalvoUserManual.pdf for OS_Stop() and OSStopTask().

(I mis-wrote in my previous post -- it's OS_Stop(), not OS_StopTask() -- sorry).

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


Re: OSStopTask

PostPosted: Mon Jan 12, 2009 12:52 pm
by Bummibaer
quote:
Use OS_StopTask() to stop the current task.

Do you mean actually I use a current task?

quote:
Use OSStopTask() to stop a particular task -- not the current one -- and one that is in a state that OSStopTask() can stop.

How can I access a running Task from elsewhere? Must I have 2 CPU's?

quote:
The error code will give you more insight as to why the API call failed.
What is the insight of OSERR?

Can you give a realworld example?

Thanks,

Steffen