From 22fc07d72ba08df8db9545da4286ccd2558ecf30 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 2 Jun 2023 15:03:02 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20ExtUI::onPl?= =?UTF-8?q?ayTone=20optional=20duration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp | 2 +- Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp | 2 +- Marlin/src/lcd/extui/anycubic_vyper/vyper_extui.cpp | 2 +- Marlin/src/lcd/extui/dgus/dgus_extui.cpp | 2 +- Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp | 2 +- Marlin/src/lcd/extui/dgus_e3s1pro/DGUSDisplay.h | 2 +- Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.cpp | 2 +- Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.h | 2 +- Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp | 2 +- Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h | 2 +- Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp | 2 +- Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h | 2 +- Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp | 2 +- Marlin/src/lcd/extui/example/example.cpp | 2 +- Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp | 2 +- Marlin/src/lcd/extui/ia_creality/ia_creality_extui.cpp | 2 +- Marlin/src/lcd/extui/malyan/malyan_extui.cpp | 2 +- Marlin/src/lcd/extui/nextion/nextion_extui.cpp | 2 +- Marlin/src/lcd/extui/ui_api.h | 3 ++- 19 files changed, 20 insertions(+), 19 deletions(-) diff --git a/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp b/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp index 4ed0461afe..c29f165d24 100644 --- a/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp +++ b/Marlin/src/lcd/extui/anycubic_chiron/chiron_extui.cpp @@ -49,7 +49,7 @@ namespace ExtUI { void onMediaError() { chiron.mediaEvent(AC_media_error); } void onMediaRemoved() { chiron.mediaEvent(AC_media_removed); } - void onPlayTone(const uint16_t frequency, const uint16_t duration) { + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) { #if ENABLED(SPEAKER) ::tone(BEEPER_PIN, frequency, duration); #endif diff --git a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp index 2bd2a458b8..0006091cda 100644 --- a/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp +++ b/Marlin/src/lcd/extui/anycubic_i3mega/anycubic_extui.cpp @@ -41,7 +41,7 @@ namespace ExtUI { void onMediaInserted() { anycubicTFT.onSDCardStateChange(true); } void onMediaError() { anycubicTFT.onSDCardError(); } void onMediaRemoved() { anycubicTFT.onSDCardStateChange(false); } - void onPlayTone(const uint16_t frequency, const uint16_t duration) { + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) { TERN_(SPEAKER, ::tone(BEEPER_PIN, frequency, duration)); } void onPrintTimerStarted() { anycubicTFT.onPrintTimerStarted(); } diff --git a/Marlin/src/lcd/extui/anycubic_vyper/vyper_extui.cpp b/Marlin/src/lcd/extui/anycubic_vyper/vyper_extui.cpp index 470fe10c43..d4351a4dab 100644 --- a/Marlin/src/lcd/extui/anycubic_vyper/vyper_extui.cpp +++ b/Marlin/src/lcd/extui/anycubic_vyper/vyper_extui.cpp @@ -49,7 +49,7 @@ namespace ExtUI { void onMediaError() { dgus.mediaEvent(AC_media_error); } void onMediaRemoved() { dgus.mediaEvent(AC_media_removed); } - void onPlayTone(const uint16_t frequency, const uint16_t duration) { + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) { #if ENABLED(SPEAKER) ::tone(BEEPER_PIN, frequency, duration); #endif diff --git a/Marlin/src/lcd/extui/dgus/dgus_extui.cpp b/Marlin/src/lcd/extui/dgus/dgus_extui.cpp index 30d1c710b2..b956d62b36 100644 --- a/Marlin/src/lcd/extui/dgus/dgus_extui.cpp +++ b/Marlin/src/lcd/extui/dgus/dgus_extui.cpp @@ -52,7 +52,7 @@ namespace ExtUI { void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); } void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); } - void onPlayTone(const uint16_t frequency, const uint16_t duration) {} + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {} void onPrintTimerStarted() {} void onPrintTimerPaused() {} void onPrintTimerStopped() {} diff --git a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp index 5878d145ea..d78364cb3b 100644 --- a/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp +++ b/Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp @@ -33,7 +33,7 @@ #include "../../../../module/planner.h" #include "../../ui_api.h" -#include "../../../marlinui.h" +#include "../../../marlinui.h" // For material presets #if HAS_STEALTHCHOP #include "../../../../module/stepper/trinamic.h" diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSDisplay.h b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSDisplay.h index 8d8a3cf013..f635c3191b 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSDisplay.h +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSDisplay.h @@ -71,7 +71,7 @@ public: write(addr, static_cast(&data), sizeof(T)); } - // Until now I did not need to actively read from the display. That's why there is no ReadVariable + // Until now I did not need to actively read from the display. That's why there is no readVariable // (I extensively use the auto upload of the display) // Read GUI and OS version from screen diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.cpp index 94c881f384..58313e4333 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.cpp @@ -281,7 +281,7 @@ void DGUSScreenHandler::configurationStoreRead(bool success) { } } -void DGUSScreenHandler::playTone(const uint16_t frequency, const uint16_t duration) { +void DGUSScreenHandler::playTone(const uint16_t frequency, const uint16_t duration/*=0*/) { if (WITHIN(frequency, 1, 255)) { if (WITHIN(duration, 1, 255)) dgus.playSound((uint8_t)frequency, (uint8_t)duration); diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.h index 9220f09aa3..a5f053043c 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/DGUSScreenHandler.h @@ -99,7 +99,7 @@ public: static void configurationStoreWritten(bool success); static void configurationStoreRead(bool success); - static void playTone(const uint16_t frequency, const uint16_t duration); + static void playTone(const uint16_t frequency, const uint16_t duration=0); static void angryBeeps(const uint8_t beepCount); static void levelingStart(); diff --git a/Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp b/Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp index 4916c0b59e..fbd8c994c7 100644 --- a/Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp +++ b/Marlin/src/lcd/extui/dgus_e3s1pro/dgus_e3s1pro_extui.cpp @@ -59,7 +59,7 @@ namespace ExtUI { void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); } void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); } - void onPlayTone(const uint16_t frequency, const uint16_t duration) { + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) { screen.playTone(frequency, duration); } diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h index 7c27162ce6..63830ddee5 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.h @@ -74,7 +74,7 @@ public: write(addr, static_cast(&data), sizeof(T)); } - // Until now I did not need to actively read from the display. That's why there is no ReadVariable + // Until now I did not need to actively read from the display. That's why there is no readVariable // (I extensively use the auto upload of the display) // Read GUI and OS version from screen diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp index 703c56d1e1..87a0f6ce12 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp @@ -224,7 +224,7 @@ void DGUSScreenHandler::configurationStoreRead(bool success) { } } -void DGUSScreenHandler::playTone(const uint16_t frequency, const uint16_t duration) { +void DGUSScreenHandler::playTone(const uint16_t frequency, const uint16_t duration/*=0*/) { if (WITHIN(frequency, 1, 255)) { if (WITHIN(duration, 1, 255)) dgus.playSound((uint8_t)frequency, (uint8_t)duration); diff --git a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h index e5942ad44d..2cffd55e23 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h +++ b/Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.h @@ -45,7 +45,7 @@ public: static void configurationStoreWritten(bool success); static void configurationStoreRead(bool success); - static void playTone(const uint16_t frequency, const uint16_t duration); + static void playTone(const uint16_t frequency, const uint16_t duration=0); static void meshUpdate(const int8_t xpos, const int8_t ypos); static void printTimerStarted(); static void printTimerPaused(); diff --git a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp index 68e405776e..3e4911f765 100644 --- a/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp +++ b/Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp @@ -54,7 +54,7 @@ namespace ExtUI { void onMediaError() { TERN_(HAS_MEDIA, screen.sdCardError()); } void onMediaRemoved() { TERN_(HAS_MEDIA, screen.sdCardRemoved()); } - void onPlayTone(const uint16_t frequency, const uint16_t duration) { + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) { screen.playTone(frequency, duration); } diff --git a/Marlin/src/lcd/extui/example/example.cpp b/Marlin/src/lcd/extui/example/example.cpp index e78e4b9679..46faa49868 100644 --- a/Marlin/src/lcd/extui/example/example.cpp +++ b/Marlin/src/lcd/extui/example/example.cpp @@ -50,7 +50,7 @@ namespace ExtUI { void onMediaInserted() {} void onMediaError() {} void onMediaRemoved() {} - void onPlayTone(const uint16_t frequency, const uint16_t duration) {} + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {} void onPrintTimerStarted() {} void onPrintTimerPaused() {} void onPrintTimerStopped() {} diff --git a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp index dc49a77ff8..d89e90ece1 100644 --- a/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp +++ b/Marlin/src/lcd/extui/ftdi_eve_touch_ui/ftdi_eve_extui.cpp @@ -108,7 +108,7 @@ namespace ExtUI { } void onSettingsLoaded(const bool) {} - void onPlayTone(const uint16_t frequency, const uint16_t duration) { sound.play_tone(frequency, duration); } + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) { sound.play_tone(frequency, duration); } void onUserConfirmRequired(const char * const msg) { if (msg) diff --git a/Marlin/src/lcd/extui/ia_creality/ia_creality_extui.cpp b/Marlin/src/lcd/extui/ia_creality/ia_creality_extui.cpp index 490e427b85..1c64df500f 100644 --- a/Marlin/src/lcd/extui/ia_creality/ia_creality_extui.cpp +++ b/Marlin/src/lcd/extui/ia_creality/ia_creality_extui.cpp @@ -98,7 +98,7 @@ void onMediaRemoved() { } } -void onPlayTone(const uint16_t frequency, const uint16_t duration) { +void onPlayTone(const uint16_t, const uint16_t/*=0*/) { rts.sendData(StartSoundSet, SoundAddr); } diff --git a/Marlin/src/lcd/extui/malyan/malyan_extui.cpp b/Marlin/src/lcd/extui/malyan/malyan_extui.cpp index f82f1f06a7..4865f42354 100644 --- a/Marlin/src/lcd/extui/malyan/malyan_extui.cpp +++ b/Marlin/src/lcd/extui/malyan/malyan_extui.cpp @@ -137,7 +137,7 @@ namespace ExtUI { void onMediaInserted() {} void onMediaError() {} void onMediaRemoved() {} - void onPlayTone(const uint16_t, const uint16_t) {} + void onPlayTone(const uint16_t, const uint16_t/*=0*/) {} void onFilamentRunout(const extruder_t extruder) {} void onUserConfirmRequired(const char * const) {} void onHomingStart() {} diff --git a/Marlin/src/lcd/extui/nextion/nextion_extui.cpp b/Marlin/src/lcd/extui/nextion/nextion_extui.cpp index b1e1997a3a..e33268f3a3 100644 --- a/Marlin/src/lcd/extui/nextion/nextion_extui.cpp +++ b/Marlin/src/lcd/extui/nextion/nextion_extui.cpp @@ -41,7 +41,7 @@ namespace ExtUI { void onMediaInserted() {} void onMediaError() {} void onMediaRemoved() {} - void onPlayTone(const uint16_t frequency, const uint16_t duration) {} + void onPlayTone(const uint16_t frequency, const uint16_t duration/*=0*/) {} void onPrintTimerStarted() {} void onPrintTimerPaused() {} void onPrintTimerStopped() {} diff --git a/Marlin/src/lcd/extui/ui_api.h b/Marlin/src/lcd/extui/ui_api.h index 28c34bd08a..50ecd13d75 100644 --- a/Marlin/src/lcd/extui/ui_api.h +++ b/Marlin/src/lcd/extui/ui_api.h @@ -43,6 +43,7 @@ ****************************************************************************/ #include "../../inc/MarlinConfig.h" + #include "../marlinui.h" #include "../../gcode/gcode.h" @@ -460,7 +461,7 @@ namespace ExtUI { void onMediaInserted(); void onMediaError(); void onMediaRemoved(); - void onPlayTone(const uint16_t frequency, const uint16_t duration); + void onPlayTone(const uint16_t frequency, const uint16_t duration=0); void onPrinterKilled(FSTR_P const error, FSTR_P const component); void onSurviveInKilled(); void onPrintTimerStarted();