Code:
volatile int status = 0;
void systick_isr() {
systick_millis_count++; // Original ISR code
status = !status;
}
void setup() {
Serial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, status);
Serial.print(systick_millis_count);
Serial.print(" - ");
Serial.println(status);
delay(1000);
}
Observation
The value of status does not change until systick_millis_count becomes 160400 (about 2 minutes 40 seconds later)
The value of status changes again at 319402.
The code was tested on Teensy 3.1 and Teensy 3.6. Both boards exhibit the same behaviour.