Page 1 of 1

example of an C task switch within a timer handler?

Posted: Sat May 09, 2009 11:16 am
by ehenkes
I search for an example of a C/inline asm task switch within a timer handler. Is there a good example (not JM's tut, that's not useful in a timer handler as far as I see).

Re: example of an C task switch within a timer handler?

Posted: Sat May 09, 2009 11:23 am
by salil_bhagurkar
I think it can be used in a timer handler, provided you take care of the interrupt status (possibly the flag) before and after switching. This depends on the code. All you need to do is call the code in the timer.

The timer interrupt basically comes in when the currently running task is interrupted. So when you switch to another task and then come back, it will resume in the timer interrupt and then return to the actual task. So the functionality IMHO remains the same.