why should i not just reenable the interrupt?
Submitted By: Erik Malund FAQ Last Modified: 12/07/06
- Reenabling by IE |= 0x80
An often seen faulty approach is
ASM
clr EA
...
setb EA
C:
EA = FALSE // disable interrupts
….
EA = TRUE // reenable the interrupts
the problem with the above is that IE |= 0x80 does not reenable, it enables. Thus if the interrupts were (or by some unsuspecting sod someday in the future) disabled, this could create havoc.
The proper method:
ASM:
push IE
clr EA
…
pop IE
C:
iesave = IE;
EA = 0;
…
IE = iesave;
Add Information to this FAQ: If you have additional information or alternative solutions to this question, you may add to this FAQ by clicking here.