Skip to content
Snippets Groups Projects
Commit 6110d57c authored by Scott Lahteine's avatar Scott Lahteine
Browse files

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

parent b73203a0
Branches
Tags
No related merge requests found
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#ifndef __BUZZER_H__ #ifndef __BUZZER_H__
#define __BUZZER_H__ #define __BUZZER_H__
#include "types.h"
#include "fastio.h" #include "fastio.h"
#include "circularqueue.h" #include "circularqueue.h"
#include "temperature.h" #include "temperature.h"
...@@ -127,7 +128,9 @@ class Buzzer { ...@@ -127,7 +128,9 @@ class Buzzer {
if (this->state.tone.frequency > 0) { if (this->state.tone.frequency > 0) {
#if ENABLED(SPEAKER) #if ENABLED(SPEAKER)
CRITICAL_SECTION_START;
::tone(BEEPER_PIN, this->state.tone.frequency, this->state.tone.duration); ::tone(BEEPER_PIN, this->state.tone.frequency, this->state.tone.duration);
CRITICAL_SECTION_END;
#else #else
this->on(); this->on();
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment