| ||||||||
Technical Support Support Resources Product Information | GENERAL: DUMMY INTERRUPT SERVICE ROUTINESQUESTIONHow do I insert dummy interrupt vectors in my code for debug purposes? ANSWERCreate an interrupt service routine using the interrupt keyword for each unused interrupt. In these routines, use a while (1) {} statement to create a tight loop jumping to itself. The following is a typical example:
void empty_isr (void) interrupt 0
{
while (1) {};
}
Copy it for each interrupt and remember to change the interrupt number. If you forget, the linker posts an error message about code space overlap. If a spurious interrupt is received, your interrupt handler halts your program in this tight loop. This may give you an idea where the problem may lie. Last Reviewed: Saturday, May 08, 2004 | |||||||
| ||||||||