shookti
Active member
Code:
volatile bool pauseInterruptPrints = false;
IntervalTimer timer1;
IntervalTimer timer2;
void setup() {
Serial.begin(500000);
timer1.priority(50);
timer2.priority(100);
timer1.begin(spam, 1000000);
timer2.begin(bacon, 2000000);
}
void loop() {
}
void spam() {
if (pauseInterruptPrints) {
Serial.println("paused");
return;
}
Serial.println("spammed");
}
void bacon() {
pauseInterruptPrints = true;
Serial.println("pausing");
delay(1000);
Serial.println("resuming");
pauseInterruptPrints = false;
}
Running on a Teensy 4.1.
Shouldn't the 'spam' interrupt print 'paused' when bacon sets 'pauseInterruptPrints' to true?
Instead, this is the output:
Last edited: