Page 1 of 1

Some help with SetAlarm()

Posted: Thu Dec 02, 2004 11:54 pm
by PrimeTime
Hi again,

I'm having trouble finding any documentation on the EE's SetAlarm.

I'm wondering if when an alarm is set, it will call it's callback function even if there is another thread currently running.

Could anyone give me an example of how SetAlarm is used, or at least describe the parameters. When I try to use this function, my program will throw an exception.

My goal is to use a callback function that will be triggered by the alarm to cycle through my created threads.

Thanks again,
Ryan

Posted: Fri Dec 03, 2004 1:13 am
by mrbrown
The callback function is executed in the same context as DMAC and INTC interrupt handlers. You have a very small stack and you cannot execute the non "i" versions of kernel syscalls.

The only types of things you should be doing in your callback are signalling a semaphore or rotating the thread queue, IOW, the "i" versions of thread operations.