Extensible user interface API (#11193)

This commit is contained in:
Marcio Teixeira
2018-10-08 14:44:05 -06:00
committed by Scott Lahteine
parent ee253991d4
commit 906a24fa81
88 changed files with 1571 additions and 25 deletions

View File

@ -27,6 +27,10 @@
#include "buzzer.h"
#include "../module/temperature.h"
#if ENABLED(EXTENSIBLE_UI)
#include "../lcd/extensible_ui/ui_api.h"
#endif
Buzzer::state_t Buzzer::state;
CircularQueue<tone_t, TONE_QUEUE_LENGTH> Buzzer::buffer;
Buzzer buzzer;
@ -58,7 +62,11 @@ void Buzzer::tick() {
state.endtime = now + state.tone.duration;
if (state.tone.frequency > 0) {
#if ENABLED(SPEAKER)
#if ENABLED(EXTENSIBLE_UI)
CRITICAL_SECTION_START;
UI::onPlayTone(state.tone.frequency, state.tone.duration);
CRITICAL_SECTION_END;
#elif ENABLED(SPEAKER)
CRITICAL_SECTION_START;
::tone(BEEPER_PIN, state.tone.frequency, state.tone.duration);
CRITICAL_SECTION_END;

View File

@ -28,7 +28,7 @@
// Make a buzzer and macro
#if ENABLED(LCD_USE_I2C_BUZZER)
// BUZZ() will be defined in ultralcd.h
#elif PIN_EXISTS(BEEPER)
#elif PIN_EXISTS(BEEPER) || ENABLED(EXTENSIBLE_UI)
#include "circularqueue.h"