Преглед изворни кода

Do not recursively enter temperature_isr

Disable the interrupt source instead, which avoids the added latency of
reentering the isr in the first place.
Yuri D'Elia пре 2 година
родитељ
комит
2535d072c4
1 измењених фајлова са 5 додато и 9 уклоњено
  1. 5 9
      Firmware/temperature.cpp

+ 5 - 9
Firmware/temperature.cpp

@@ -1777,15 +1777,11 @@ ISR(TIMER2_COMPB_vect)
 ISR(TIMER0_COMPB_vect)
 #endif //SYSTEM_TIMER_2
 {
-    static bool _lock = false;
-    if (!_lock)
-    {
-        _lock = true;
-        sei();
-        temperature_isr();
-        cli();
-        _lock = false;
-    }
+    DISABLE_TEMPERATURE_INTERRUPT();
+    sei();
+    temperature_isr();
+    cli();
+    ENABLE_TEMPERATURE_INTERRUPT();
 }
 
 void check_max_temp()