In general, on AVR devices, interrupts have been turned off (by hardware) when an ISR (interrupt service routine) begins execution.
Thus, if on_encoder_pulse()
is an ISR and is invoked due to an interrupt, it will run uninterrupted.
An ISR that within itself turns the interrupt system back on before it's done runs the risk of other interrupts being serviced before it completes.
The suggestion that ISR's be "as short and fast as possible" is intended to avoid other interrupts being missed, as will happen if an interrupt source activates multiple times while the interrupt system is off. Most interrupt sources latch a bit and will be handled when the interrupt system is re-enabled; some don't latch a bit, and won't be seen if some ISR is long-winded.
In general, on AVR devices, interrupts have been turned off (by hardware) when an ISR (interrupt service routine) begins execution.
Thus, if on_encoder_pulse()
is an ISR and is invoked due to an interrupt, it will run uninterrupted.
An ISR that within itself turns the interrupt system back on before it's done runs the risk of other interrupts being serviced before it completes.
In general, on AVR devices, interrupts have been turned off (by hardware) when an ISR (interrupt service routine) begins execution.
Thus, if on_encoder_pulse()
is an ISR and is invoked due to an interrupt, it will run uninterrupted.
An ISR that within itself turns the interrupt system back on before it's done runs the risk of other interrupts being serviced before it completes.
The suggestion that ISR's be "as short and fast as possible" is intended to avoid other interrupts being missed, as will happen if an interrupt source activates multiple times while the interrupt system is off. Most interrupt sources latch a bit and will be handled when the interrupt system is re-enabled; some don't latch a bit, and won't be seen if some ISR is long-winded.
In general, on AVR devices, interrupts have been turned off (by hardware) when an ISR (interrupt service routine) begins execution.
Thus, if on_encoder_pulse()
is an ISR and is invoked due to an interrupt, it will run uninterrupted.
An ISR that within itself turns the interrupt system back on before it's done runs the risk of other interrupts being serviced before it completes.