Browse Source

More EEPROM cleanup

Scott Lahteine 4 years ago
parent
commit
6320f9795c
1 changed files with 20 additions and 21 deletions
  1. 20
    21
      Marlin/src/module/configuration_store.cpp

+ 20
- 21
Marlin/src/module/configuration_store.cpp View File

2768
 
2768
 
2769
   static void config_heading(const bool repl, PGM_P const pstr, const bool eol=true) {
2769
   static void config_heading(const bool repl, PGM_P const pstr, const bool eol=true) {
2770
     if (!repl) {
2770
     if (!repl) {
2771
-      CONFIG_ECHO_START();
2771
+      SERIAL_ECHO_START();
2772
       SERIAL_ECHOPGM("; ");
2772
       SERIAL_ECHOPGM("; ");
2773
       serialprintPGM(pstr);
2773
       serialprintPGM(pstr);
2774
       if (eol) SERIAL_EOL();
2774
       if (eol) SERIAL_EOL();
2777
 
2777
 
2778
   #define CONFIG_ECHO_START()       do{ if (!forReplay) SERIAL_ECHO_START(); }while(0)
2778
   #define CONFIG_ECHO_START()       do{ if (!forReplay) SERIAL_ECHO_START(); }while(0)
2779
   #define CONFIG_ECHO_MSG(STR)      do{ CONFIG_ECHO_START(); SERIAL_ECHOLNPGM(STR); }while(0)
2779
   #define CONFIG_ECHO_MSG(STR)      do{ CONFIG_ECHO_START(); SERIAL_ECHOLNPGM(STR); }while(0)
2780
-  #define CONFIG_ECHO_HEADING(STR, V...) config_heading(forReplay, PSTR(STR), V)
2780
+  #define CONFIG_ECHO_HEADING(STR)  config_heading(forReplay, PSTR(STR))
2781
 
2781
 
2782
   #if HAS_TRINAMIC
2782
   #if HAS_TRINAMIC
2783
     inline void say_M906(const bool forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOPGM("  M906"); }
2783
     inline void say_M906(const bool forReplay) { CONFIG_ECHO_START(); SERIAL_ECHOPGM("  M906"); }
2861
        * Volumetric extrusion M200
2861
        * Volumetric extrusion M200
2862
        */
2862
        */
2863
       if (!forReplay) {
2863
       if (!forReplay) {
2864
-        CONFIG_ECHO_START();
2865
-        SERIAL_ECHOPGM("Filament settings:");
2864
+        config_heading(forReplay, PSTR("Filament settings:"), false);
2866
         if (parser.volumetric_enabled)
2865
         if (parser.volumetric_enabled)
2867
           SERIAL_EOL();
2866
           SERIAL_EOL();
2868
         else
2867
         else
2936
       , SP_T_STR, LINEAR_UNIT(planner.settings.travel_acceleration)
2935
       , SP_T_STR, LINEAR_UNIT(planner.settings.travel_acceleration)
2937
     );
2936
     );
2938
 
2937
 
2939
-    if (!forReplay) {
2940
-      CONFIG_ECHO_START();
2941
-      SERIAL_ECHOPGM("Advanced: B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>");
2938
+    CONFIG_ECHO_HEADING(
2939
+      "Advanced: B<min_segment_time_us> S<min_feedrate> T<min_travel_feedrate>"
2942
       #if DISABLED(CLASSIC_JERK)
2940
       #if DISABLED(CLASSIC_JERK)
2943
-        SERIAL_ECHOPGM(" J<junc_dev>");
2941
+        " J<junc_dev>"
2944
       #endif
2942
       #endif
2945
       #if HAS_CLASSIC_JERK
2943
       #if HAS_CLASSIC_JERK
2946
-        SERIAL_ECHOPGM(" X<max_x_jerk> Y<max_y_jerk> Z<max_z_jerk>");
2944
+        " X<max_x_jerk> Y<max_y_jerk> Z<max_z_jerk>"
2947
         #if HAS_CLASSIC_E_JERK
2945
         #if HAS_CLASSIC_E_JERK
2948
-          SERIAL_ECHOPGM(" E<max_e_jerk>");
2946
+          " E<max_e_jerk>"
2949
         #endif
2947
         #endif
2950
       #endif
2948
       #endif
2951
-      SERIAL_EOL();
2952
-    }
2949
+    );
2953
     CONFIG_ECHO_START();
2950
     CONFIG_ECHO_START();
2954
     SERIAL_ECHOLNPAIR_P(
2951
     SERIAL_ECHOLNPAIR_P(
2955
         PSTR("  M205 B"), LINEAR_UNIT(planner.settings.min_segment_time_us)
2952
         PSTR("  M205 B"), LINEAR_UNIT(planner.settings.min_segment_time_us)
3007
 
3004
 
3008
       #elif ENABLED(AUTO_BED_LEVELING_UBL)
3005
       #elif ENABLED(AUTO_BED_LEVELING_UBL)
3009
 
3006
 
3007
+        config_heading(forReplay, PSTR(""), false);
3010
         if (!forReplay) {
3008
         if (!forReplay) {
3011
-          CONFIG_ECHO_START();
3012
           ubl.echo_name();
3009
           ubl.echo_name();
3013
-          SERIAL_ECHOLNPGM(":");
3010
+          SERIAL_CHAR(':');
3011
+          SERIAL_EOL();
3014
         }
3012
         }
3015
 
3013
 
3016
       #elif HAS_ABL_OR_UBL
3014
       #elif HAS_ABL_OR_UBL
3046
         if (!forReplay) {
3044
         if (!forReplay) {
3047
           SERIAL_EOL();
3045
           SERIAL_EOL();
3048
           ubl.report_state();
3046
           ubl.report_state();
3049
-          SERIAL_ECHOLNPAIR("\nActive Mesh Slot: ", ubl.storage_slot);
3050
-          SERIAL_ECHOLNPAIR("EEPROM can hold ", calc_num_meshes(), " meshes.\n");
3047
+          SERIAL_EOL();
3048
+          config_heading(false, PSTR("Active Mesh Slot: "), false);
3049
+          SERIAL_ECHOLN(ubl.storage_slot);
3050
+          config_heading(false, PSTR("EEPROM can hold "), false);
3051
+          SERIAL_ECHO(calc_num_meshes());
3052
+          SERIAL_ECHOLNPGM(" meshes.\n");
3051
         }
3053
         }
3052
 
3054
 
3053
        //ubl.report_current_mesh();   // This is too verbose for large meshes. A better (more terse)
3055
        //ubl.report_current_mesh();   // This is too verbose for large meshes. A better (more terse)
3257
      * Probe Offset
3259
      * Probe Offset
3258
      */
3260
      */
3259
     #if HAS_BED_PROBE
3261
     #if HAS_BED_PROBE
3260
-      if (!forReplay) {
3261
-        CONFIG_ECHO_START();
3262
-        SERIAL_ECHOPGM("Z-Probe Offset");
3263
-        say_units(true);
3264
-      }
3262
+      config_heading(forReplay, PSTR("Z-Probe Offset"), false);
3263
+      if (!forReplay) say_units(true);
3265
       CONFIG_ECHO_START();
3264
       CONFIG_ECHO_START();
3266
       SERIAL_ECHOLNPAIR_P(
3265
       SERIAL_ECHOLNPAIR_P(
3267
         #if HAS_PROBE_XY_OFFSET
3266
         #if HAS_PROBE_XY_OFFSET

Loading…
Cancel
Save