Interrupt Service Routines
If the amount of time to perform the critical task takes longer than the interim of the interrupt, then your design is flawed. Take note of the word critical. Paul, I think you have solved your problem by shortening the critical code to fit within the interim. If not, then you would have to break up your interrupt routine into states and run sub-portions of the critical code in some sort of state machine. But then again, if what you are doing HAS to be performed within a single interrupt interim, you would be continually getting behind so as to not meet the designed criteria, which is, to perform x number of interrupt routines each second of real time. If the interrupt was initiated on a non-regular basis, then saving critical information and queuing up tasks to be performed at a later non-critical time is proper. But this is not your case at all. Glad to see you got the instructions minimized.
Carry on my friend. You are doing fine.
Eric
__________________
1995 BMW 318i EV in the making
|