example of an C task switch within a timer handler?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
ehenkes
Member
Member
Posts: 124
Joined: Mon Mar 23, 2009 3:15 am
Location: Germany
Contact:

example of an C task switch within a timer handler?

Post 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).
User avatar
salil_bhagurkar
Member
Member
Posts: 261
Joined: Mon Feb 19, 2007 10:40 am
Location: India

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

Post 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.
Post Reply