Browse Source

Function for CONFIG_ECHO_HEADING

Scott Lahteine 4 years ago
parent
commit
b8b225c8b5
1 changed files with 10 additions and 1 deletions
  1. 10
    1
      Marlin/src/module/configuration_store.cpp

+ 10
- 1
Marlin/src/module/configuration_store.cpp View File

@@ -2766,9 +2766,18 @@ void MarlinSettings::reset() {
2766 2766
 
2767 2767
 #if DISABLED(DISABLE_M503)
2768 2768
 
2769
+  static void config_heading(const bool repl, PGM_P const pstr, const bool eol=true) {
2770
+    if (!repl) {
2771
+      CONFIG_ECHO_START();
2772
+      SERIAL_ECHOPGM("; ");
2773
+      serialprintPGM(pstr);
2774
+      if (eol) SERIAL_EOL();
2775
+    }
2776
+  }
2777
+
2769 2778
   #define CONFIG_ECHO_START()       do{ if (!forReplay) SERIAL_ECHO_START(); }while(0)
2770 2779
   #define CONFIG_ECHO_MSG(STR)      do{ CONFIG_ECHO_START(); SERIAL_ECHOLNPGM(STR); }while(0)
2771
-  #define CONFIG_ECHO_HEADING(STR)  do{ if (!forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOLNPGM(STR); } }while(0)
2780
+  #define CONFIG_ECHO_HEADING(STR, V...) config_heading(forReplay, PSTR(STR), V)
2772 2781
 
2773 2782
   #if HAS_TRINAMIC
2774 2783
     inline void say_M906(const bool forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOPGM("  M906"); }

Loading…
Cancel
Save