This simple example shows how to use the External Interrupt Driver for nested external interrupt
The interrupt driver can be found here.
AVR MEGARF device can be used.
External interrupt INT0 pin is enabled and user defined another external interrupt source(example INT1) is also enabled.SW1 and SW2 are the switches connected to the interrupt pins
switch SW1 is pressed, due to pull-up the interrupt INT0 will be triggered only when SW1 is released and LED1 blinks for some time. During the time while LED1 is glowing, a switch action on another SW2 will trigger INT1 and hence the LED2 blinks for a moment and goes off. This is because, inside the ISR of INT0, the I-bit is set so that all other interrupts are activated. So even when the CPU is inside the INT0 routine it senses the interrupt INT1 and jumps to the ISR of INT1 and executes the routine and then jumps back to ISR of INT0.
This software was written for the GNU GCC and IAR for AVR. Other compilers may or may not work.
For further information, visit Microchip.