Consider the following ISR, which disables interrupts, increments and checks a counter, conditionally stops an interval timer or detaches interrupts, and re-enables interrupts.
This is a schematic of some code running on a Teensy 4.0.
What happens to pending timer interrupts when end() is called? Are they cleared by calling end()?
Pro-forma, I want to ask the same for the interrupts driven from the digital i/o pin. Is a pending interrupt condition from the digital i/o pin cleared by calling detachInterrupt()?
Thank you
This is a schematic of some code running on a Teensy 4.0.
What happens to pending timer interrupts when end() is called? Are they cleared by calling end()?
Pro-forma, I want to ask the same for the interrupts driven from the digital i/o pin. Is a pending interrupt condition from the digital i/o pin cleared by calling detachInterrupt()?
Thank you
Code:
void anISR() {
noInterrupts();
if ( ++counter == 10 ) {
digitalWriteFast(busyPin, LOW);
if (is_clocked) {
someTimer.end();
}
if (is_triggered) {
detachInterrupt( digitalPinToInterrupt( somePin ) );
}
}
interrupts();
}