Procházet zdrojové kódy

Prevent the 'tone(f,d)' function from being interrupted

Scott Lahteine před 7 roky
rodič
revize
6110d57c16
1 změnil soubory, kde provedl 3 přidání a 0 odebrání
  1. 3
    0
      Marlin/buzzer.h

+ 3
- 0
Marlin/buzzer.h Zobrazit soubor

@@ -23,6 +23,7 @@
23 23
 #ifndef __BUZZER_H__
24 24
 #define __BUZZER_H__
25 25
 
26
+#include "types.h"
26 27
 #include "fastio.h"
27 28
 #include "circularqueue.h"
28 29
 #include "temperature.h"
@@ -127,7 +128,9 @@ class Buzzer {
127 128
 
128 129
         if (this->state.tone.frequency > 0) {
129 130
           #if ENABLED(SPEAKER)
131
+            CRITICAL_SECTION_START;
130 132
             ::tone(BEEPER_PIN, this->state.tone.frequency, this->state.tone.duration);
133
+            CRITICAL_SECTION_END;
131 134
           #else
132 135
             this->on();
133 136
           #endif

Loading…
Zrušit
Uložit