From b8b225c8b5f7792990169563707f8afcb2cc6db9 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 20 Feb 2020 20:09:59 -0600 Subject: [PATCH] Function for CONFIG_ECHO_HEADING --- Marlin/src/module/configuration_store.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index a029443328..0ae3923344 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -2766,9 +2766,18 @@ void MarlinSettings::reset() { #if DISABLED(DISABLE_M503) + static void config_heading(const bool repl, PGM_P const pstr, const bool eol=true) { + if (!repl) { + CONFIG_ECHO_START(); + SERIAL_ECHOPGM("; "); + serialprintPGM(pstr); + if (eol) SERIAL_EOL(); + } + } + #define CONFIG_ECHO_START() do{ if (!forReplay) SERIAL_ECHO_START(); }while(0) #define CONFIG_ECHO_MSG(STR) do{ CONFIG_ECHO_START(); SERIAL_ECHOLNPGM(STR); }while(0) - #define CONFIG_ECHO_HEADING(STR) do{ if (!forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOLNPGM(STR); } }while(0) + #define CONFIG_ECHO_HEADING(STR, V...) config_heading(forReplay, PSTR(STR), V) #if HAS_TRINAMIC inline void say_M906(const bool forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOPGM(" M906"); }