Преглед на файлове

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

Scott Lahteine преди 9 години
родител
ревизия
6110d57c16
променени са 1 файла, в които са добавени 3 реда и са изтрити 0 реда
  1. 3
    0
      Marlin/buzzer.h

+ 3
- 0
Marlin/buzzer.h Целия файл

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

Loading…
Отказ
Запис