Переглянути джерело

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

Scott Lahteine 8 роки тому
джерело
коміт
6110d57c16
1 змінених файлів з 3 додано та 0 видалено
  1. 3
    0
      Marlin/buzzer.h

+ 3
- 0
Marlin/buzzer.h Переглянути файл

@@ -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

Завантаження…
Відмінити
Зберегти