浏览代码

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

正在加载...
取消
保存