Ttelmah
Joined: 11 Mar 2010 Posts: 19539
|
|
Posted: Mon Mar 31, 2014 11:05 am |
|
|
They don't.....
Look at the example files. None of the ISR's ever calls 'enable_interrupts(GLOBAL)'.
Search here, and you will find the (thankfully) few people doing this, being told quite forcibly _not_ to do it. It is lethal (to the program). The 'disable' won't cause any problem (since the interrupt is already disabled when you enter the ISR code), but 'enable_interrupt(GLOBAL)', inside an ISR, can result in the ISR being called again inside itself, and will then crash the code.
The key point is that the return instruction used in an ISR (RETFIE) enables the global interrupt _after_ it executes, ensuring the code has left the ISR before the interrupts are re-enabled.... |
|