From cabd538fdd03bec0b293cb290bbc3dc123da780a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 27 Sep 2021 13:40:01 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Apply=20F()=20to=20G-code=20repo?= =?UTF-8?q?rt=20header?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/gcode/bedlevel/M420.cpp | 2 +- Marlin/src/gcode/calibrate/G34_M422.cpp | 2 +- Marlin/src/gcode/calibrate/M425.cpp | 2 +- Marlin/src/gcode/calibrate/M665.cpp | 6 +++--- Marlin/src/gcode/calibrate/M666.cpp | 4 ++-- Marlin/src/gcode/calibrate/M852.cpp | 2 +- Marlin/src/gcode/config/M200-M205.cpp | 10 +++++----- Marlin/src/gcode/config/M217.cpp | 2 +- Marlin/src/gcode/config/M218.cpp | 2 +- Marlin/src/gcode/config/M281.cpp | 2 +- Marlin/src/gcode/config/M301.cpp | 2 +- Marlin/src/gcode/config/M304.cpp | 2 +- Marlin/src/gcode/config/M309.cpp | 2 +- Marlin/src/gcode/config/M92.cpp | 2 +- Marlin/src/gcode/control/M211.cpp | 2 +- Marlin/src/gcode/feature/advance/M900.cpp | 2 +- Marlin/src/gcode/feature/controllerfan/M710.cpp | 2 +- Marlin/src/gcode/feature/digipot/M907-M910.cpp | 2 +- Marlin/src/gcode/feature/fwretract/M207-M209.cpp | 6 +++--- Marlin/src/gcode/feature/pause/M603.cpp | 2 +- Marlin/src/gcode/feature/powerloss/M413.cpp | 2 +- Marlin/src/gcode/feature/runout/M412.cpp | 2 +- Marlin/src/gcode/feature/trinamic/M569.cpp | 2 +- Marlin/src/gcode/feature/trinamic/M906.cpp | 2 +- Marlin/src/gcode/feature/trinamic/M911-M914.cpp | 4 ++-- Marlin/src/gcode/gcode.cpp | 6 +++--- Marlin/src/gcode/gcode.h | 6 +++--- Marlin/src/gcode/geometry/M206_M428.cpp | 2 +- Marlin/src/gcode/lcd/M145.cpp | 2 +- Marlin/src/gcode/lcd/M250.cpp | 2 +- Marlin/src/gcode/lcd/M256.cpp | 2 +- Marlin/src/gcode/lcd/M414.cpp | 2 +- Marlin/src/gcode/probe/M851.cpp | 2 +- Marlin/src/gcode/units/M149.cpp | 2 +- Marlin/src/module/settings.cpp | 2 +- Marlin/src/module/temperature.cpp | 2 +- 36 files changed, 50 insertions(+), 50 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/M420.cpp b/Marlin/src/gcode/bedlevel/M420.cpp index 1240b14fd2..5dcef961ee 100644 --- a/Marlin/src/gcode/bedlevel/M420.cpp +++ b/Marlin/src/gcode/bedlevel/M420.cpp @@ -243,7 +243,7 @@ void GcodeSuite::M420() { } void GcodeSuite::M420_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR( + report_heading_etc(forReplay, F( TERN(MESH_BED_LEVELING, "Mesh Bed Leveling", TERN(AUTO_BED_LEVELING_UBL, "Unified Bed Leveling", "Auto Bed Leveling")) )); SERIAL_ECHOF( diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index 25855e6a4e..8f4eab2c97 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -538,7 +538,7 @@ void GcodeSuite::M422() { } void GcodeSuite::M422_report(const bool forReplay/*=true*/) { - report_heading(forReplay, PSTR(STR_Z_AUTO_ALIGN)); + report_heading(forReplay, F(STR_Z_AUTO_ALIGN)); LOOP_L_N(i, NUM_Z_STEPPER_DRIVERS) { report_echo_start(forReplay); SERIAL_ECHOLNPGM_P( diff --git a/Marlin/src/gcode/calibrate/M425.cpp b/Marlin/src/gcode/calibrate/M425.cpp index 1d314a37d3..190af0f71b 100644 --- a/Marlin/src/gcode/calibrate/M425.cpp +++ b/Marlin/src/gcode/calibrate/M425.cpp @@ -114,7 +114,7 @@ void GcodeSuite::M425() { } void GcodeSuite::M425_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_BACKLASH_COMPENSATION)); + report_heading_etc(forReplay, F(STR_BACKLASH_COMPENSATION)); SERIAL_ECHOLNPGM_P( PSTR(" M425 F"), backlash.get_correction() #ifdef BACKLASH_SMOOTHING_MM diff --git a/Marlin/src/gcode/calibrate/M665.cpp b/Marlin/src/gcode/calibrate/M665.cpp index 11de1ce434..aa21471b60 100644 --- a/Marlin/src/gcode/calibrate/M665.cpp +++ b/Marlin/src/gcode/calibrate/M665.cpp @@ -62,7 +62,7 @@ } void GcodeSuite::M665_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_DELTA_SETTINGS)); + report_heading_etc(forReplay, F(STR_DELTA_SETTINGS)); SERIAL_ECHOLNPGM_P( PSTR(" M665 L"), LINEAR_UNIT(delta_diagonal_rod) , PSTR(" R"), LINEAR_UNIT(delta_radius) @@ -132,7 +132,7 @@ } void GcodeSuite::M665_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_SCARA_SETTINGS " (" STR_S_SEG_PER_SEC TERN_(HAS_SCARA_OFFSET, " " STR_SCARA_P_T_Z) ")")); + report_heading_etc(forReplay, F(STR_SCARA_SETTINGS " (" STR_S_SEG_PER_SEC TERN_(HAS_SCARA_OFFSET, " " STR_SCARA_P_T_Z) ")")); SERIAL_ECHOLNPGM_P( PSTR(" M665 S"), segments_per_second #if HAS_SCARA_OFFSET @@ -162,7 +162,7 @@ } void GcodeSuite::M665_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_POLARGRAPH_SETTINGS " (" STR_S_SEG_PER_SEC ")")); + report_heading_etc(forReplay, F(STR_POLARGRAPH_SETTINGS " (" STR_S_SEG_PER_SEC ")")); SERIAL_ECHOLNPGM(" M665 S", segments_per_second); } diff --git a/Marlin/src/gcode/calibrate/M666.cpp b/Marlin/src/gcode/calibrate/M666.cpp index c4149c2352..15f8baf109 100644 --- a/Marlin/src/gcode/calibrate/M666.cpp +++ b/Marlin/src/gcode/calibrate/M666.cpp @@ -61,7 +61,7 @@ } void GcodeSuite::M666_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_ENDSTOP_ADJUSTMENT)); + report_heading_etc(forReplay, F(STR_ENDSTOP_ADJUSTMENT)); SERIAL_ECHOLNPGM_P( PSTR(" M666 X"), LINEAR_UNIT(delta_endstop_adj.a) , SP_Y_STR, LINEAR_UNIT(delta_endstop_adj.b) @@ -105,7 +105,7 @@ } void GcodeSuite::M666_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_ENDSTOP_ADJUSTMENT)); + report_heading_etc(forReplay, F(STR_ENDSTOP_ADJUSTMENT)); SERIAL_ECHOPGM(" M666"); #if ENABLED(X_DUAL_ENDSTOPS) SERIAL_ECHOLNPGM_P(SP_X_STR, LINEAR_UNIT(endstops.x2_endstop_adj)); diff --git a/Marlin/src/gcode/calibrate/M852.cpp b/Marlin/src/gcode/calibrate/M852.cpp index c4361b89f3..b24a449652 100644 --- a/Marlin/src/gcode/calibrate/M852.cpp +++ b/Marlin/src/gcode/calibrate/M852.cpp @@ -92,7 +92,7 @@ void GcodeSuite::M852() { } void GcodeSuite::M852_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_SKEW_FACTOR)); + report_heading_etc(forReplay, F(STR_SKEW_FACTOR)); SERIAL_ECHOPAIR_F(" M851 I", planner.skew_factor.xy, 6); #if ENABLED(SKEW_CORRECTION_FOR_Z) SERIAL_ECHOPAIR_F(" J", planner.skew_factor.xz, 6); diff --git a/Marlin/src/gcode/config/M200-M205.cpp b/Marlin/src/gcode/config/M200-M205.cpp index 2880bd9943..7b7ce5e10d 100644 --- a/Marlin/src/gcode/config/M200-M205.cpp +++ b/Marlin/src/gcode/config/M200-M205.cpp @@ -76,7 +76,7 @@ void GcodeSuite::M200_report(const bool forReplay/*=true*/) { if (!forReplay) { - report_heading(forReplay, PSTR(STR_FILAMENT_SETTINGS), false); + report_heading(forReplay, F(STR_FILAMENT_SETTINGS), false); if (!parser.volumetric_enabled) SERIAL_ECHOPGM(" (Disabled):"); SERIAL_EOL(); report_echo_start(forReplay); @@ -133,7 +133,7 @@ void GcodeSuite::M201() { } void GcodeSuite::M201_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_MAX_ACCELERATION)); + report_heading_etc(forReplay, F(STR_MAX_ACCELERATION)); SERIAL_ECHOLNPGM_P( LIST_N(DOUBLE(LINEAR_AXES), PSTR(" M201 X"), LINEAR_UNIT(planner.settings.max_acceleration_mm_per_s2[X_AXIS]), @@ -178,7 +178,7 @@ void GcodeSuite::M203() { } void GcodeSuite::M203_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_MAX_FEEDRATES)); + report_heading_etc(forReplay, F(STR_MAX_FEEDRATES)); SERIAL_ECHOLNPGM_P( LIST_N(DOUBLE(LINEAR_AXES), PSTR(" M203 X"), LINEAR_UNIT(planner.settings.max_feedrate_mm_s[X_AXIS]), @@ -224,7 +224,7 @@ void GcodeSuite::M204() { } void GcodeSuite::M204_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_ACCELERATION_P_R_T)); + report_heading_etc(forReplay, F(STR_ACCELERATION_P_R_T)); SERIAL_ECHOLNPGM_P( PSTR(" M204 P"), LINEAR_UNIT(planner.settings.acceleration) , PSTR(" R"), LINEAR_UNIT(planner.settings.retract_acceleration) @@ -285,7 +285,7 @@ void GcodeSuite::M205() { } void GcodeSuite::M205_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR( + report_heading_etc(forReplay, F( "Advanced (B S T" TERN_(HAS_JUNCTION_DEVIATION, " J") TERN_(HAS_CLASSIC_JERK, " X Y Z") diff --git a/Marlin/src/gcode/config/M217.cpp b/Marlin/src/gcode/config/M217.cpp index 1299259b53..7576272a48 100644 --- a/Marlin/src/gcode/config/M217.cpp +++ b/Marlin/src/gcode/config/M217.cpp @@ -131,7 +131,7 @@ void GcodeSuite::M217() { } void GcodeSuite::M217_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_TOOL_CHANGING)); + report_heading_etc(forReplay, F(STR_TOOL_CHANGING)); SERIAL_ECHOPGM(" M217"); diff --git a/Marlin/src/gcode/config/M218.cpp b/Marlin/src/gcode/config/M218.cpp index c95cd6c1b9..c39447a28d 100644 --- a/Marlin/src/gcode/config/M218.cpp +++ b/Marlin/src/gcode/config/M218.cpp @@ -57,7 +57,7 @@ void GcodeSuite::M218() { } void GcodeSuite::M218_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_HOTEND_OFFSETS)); + report_heading_etc(forReplay, F(STR_HOTEND_OFFSETS)); LOOP_S_L_N(e, 1, HOTENDS) { report_echo_start(forReplay); SERIAL_ECHOPGM_P( diff --git a/Marlin/src/gcode/config/M281.cpp b/Marlin/src/gcode/config/M281.cpp index ac91f08cb4..b90de6be30 100644 --- a/Marlin/src/gcode/config/M281.cpp +++ b/Marlin/src/gcode/config/M281.cpp @@ -55,7 +55,7 @@ void GcodeSuite::M281() { } void GcodeSuite::M281_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_SERVO_ANGLES)); + report_heading_etc(forReplay, F(STR_SERVO_ANGLES)); LOOP_L_N(i, NUM_SERVOS) { switch (i) { default: break; diff --git a/Marlin/src/gcode/config/M301.cpp b/Marlin/src/gcode/config/M301.cpp index db882b3b65..fc9f1883d6 100644 --- a/Marlin/src/gcode/config/M301.cpp +++ b/Marlin/src/gcode/config/M301.cpp @@ -79,7 +79,7 @@ void GcodeSuite::M301() { } void GcodeSuite::M301_report(const bool forReplay/*=true*/ E_OPTARG(const int8_t eindex/*=-1*/)) { - report_heading(forReplay, PSTR(STR_HOTEND_PID)); + report_heading(forReplay, F(STR_HOTEND_PID)); IF_DISABLED(HAS_MULTI_EXTRUDER, constexpr int8_t eindex = -1); HOTEND_LOOP() { if (e == eindex || eindex == -1) { diff --git a/Marlin/src/gcode/config/M304.cpp b/Marlin/src/gcode/config/M304.cpp index 05ee4bad80..4bd415db1e 100644 --- a/Marlin/src/gcode/config/M304.cpp +++ b/Marlin/src/gcode/config/M304.cpp @@ -42,7 +42,7 @@ void GcodeSuite::M304() { } void GcodeSuite::M304_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_BED_PID)); + report_heading_etc(forReplay, F(STR_BED_PID)); SERIAL_ECHO_MSG( " M304 P", thermalManager.temp_bed.pid.Kp , " I", unscalePID_i(thermalManager.temp_bed.pid.Ki) diff --git a/Marlin/src/gcode/config/M309.cpp b/Marlin/src/gcode/config/M309.cpp index 01c4e62347..577023292e 100644 --- a/Marlin/src/gcode/config/M309.cpp +++ b/Marlin/src/gcode/config/M309.cpp @@ -42,7 +42,7 @@ void GcodeSuite::M309() { } void GcodeSuite::M309_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_CHAMBER_PID)); + report_heading_etc(forReplay, F(STR_CHAMBER_PID)); SERIAL_ECHOLNPGM( " M309 P", thermalManager.temp_chamber.pid.Kp , " I", unscalePID_i(thermalManager.temp_chamber.pid.Ki) diff --git a/Marlin/src/gcode/config/M92.cpp b/Marlin/src/gcode/config/M92.cpp index ef11533114..54fe698f97 100644 --- a/Marlin/src/gcode/config/M92.cpp +++ b/Marlin/src/gcode/config/M92.cpp @@ -91,7 +91,7 @@ void GcodeSuite::M92() { } void GcodeSuite::M92_report(const bool forReplay/*=true*/, const int8_t e/*=-1*/) { - report_heading_etc(forReplay, PSTR(STR_STEPS_PER_UNIT)); + report_heading_etc(forReplay, F(STR_STEPS_PER_UNIT)); SERIAL_ECHOPGM_P(LIST_N(DOUBLE(LINEAR_AXES), PSTR(" M92 X"), LINEAR_UNIT(planner.settings.axis_steps_per_mm[X_AXIS]), SP_Y_STR, LINEAR_UNIT(planner.settings.axis_steps_per_mm[Y_AXIS]), diff --git a/Marlin/src/gcode/control/M211.cpp b/Marlin/src/gcode/control/M211.cpp index d108070279..95ae052a7b 100644 --- a/Marlin/src/gcode/control/M211.cpp +++ b/Marlin/src/gcode/control/M211.cpp @@ -40,7 +40,7 @@ void GcodeSuite::M211() { } void GcodeSuite::M211_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_SOFT_ENDSTOPS)); + report_heading_etc(forReplay, F(STR_SOFT_ENDSTOPS)); SERIAL_ECHOPGM(" M211 S", AS_DIGIT(soft_endstop._enabled), " ; "); serialprintln_onoff(soft_endstop._enabled); diff --git a/Marlin/src/gcode/feature/advance/M900.cpp b/Marlin/src/gcode/feature/advance/M900.cpp index 4ed601bbe8..054ea3617f 100644 --- a/Marlin/src/gcode/feature/advance/M900.cpp +++ b/Marlin/src/gcode/feature/advance/M900.cpp @@ -145,7 +145,7 @@ void GcodeSuite::M900() { } void GcodeSuite::M900_report(const bool forReplay/*=true*/) { - report_heading(forReplay, PSTR(STR_LINEAR_ADVANCE)); + report_heading(forReplay, F(STR_LINEAR_ADVANCE)); #if EXTRUDERS < 2 report_echo_start(forReplay); SERIAL_ECHOLNPGM(" M900 K", planner.extruder_advance_K[0]); diff --git a/Marlin/src/gcode/feature/controllerfan/M710.cpp b/Marlin/src/gcode/feature/controllerfan/M710.cpp index eede16b5bd..b98d88845d 100644 --- a/Marlin/src/gcode/feature/controllerfan/M710.cpp +++ b/Marlin/src/gcode/feature/controllerfan/M710.cpp @@ -67,7 +67,7 @@ void GcodeSuite::M710() { } void GcodeSuite::M710_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_CONTROLLER_FAN)); + report_heading_etc(forReplay, F(STR_CONTROLLER_FAN)); SERIAL_ECHOLNPGM(" M710" " S", int(controllerFan.settings.active_speed), " I", int(controllerFan.settings.idle_speed), diff --git a/Marlin/src/gcode/feature/digipot/M907-M910.cpp b/Marlin/src/gcode/feature/digipot/M907-M910.cpp index a0b5c48e82..757cffd473 100644 --- a/Marlin/src/gcode/feature/digipot/M907-M910.cpp +++ b/Marlin/src/gcode/feature/digipot/M907-M910.cpp @@ -100,7 +100,7 @@ void GcodeSuite::M907() { #if HAS_MOTOR_CURRENT_SPI || HAS_MOTOR_CURRENT_PWM void GcodeSuite::M907_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_STEPPER_MOTOR_CURRENTS)); + report_heading_etc(forReplay, F(STR_STEPPER_MOTOR_CURRENTS)); #if HAS_MOTOR_CURRENT_PWM SERIAL_ECHOLNPGM_P( // PWM-based has 3 values: PSTR(" M907 X"), stepper.motor_current_setting[0] // X and Y diff --git a/Marlin/src/gcode/feature/fwretract/M207-M209.cpp b/Marlin/src/gcode/feature/fwretract/M207-M209.cpp index 040a09a8e0..173c2894dc 100644 --- a/Marlin/src/gcode/feature/fwretract/M207-M209.cpp +++ b/Marlin/src/gcode/feature/fwretract/M207-M209.cpp @@ -38,7 +38,7 @@ void GcodeSuite::M207() { fwretract.M207(); } void GcodeSuite::M207_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_RETRACT_S_F_Z)); + report_heading_etc(forReplay, F(STR_RETRACT_S_F_Z)); fwretract.M207_report(); } @@ -53,7 +53,7 @@ void GcodeSuite::M207_report(const bool forReplay/*=true*/) { void GcodeSuite::M208() { fwretract.M208(); } void GcodeSuite::M208_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_RECOVER_S_F)); + report_heading_etc(forReplay, F(STR_RECOVER_S_F)); fwretract.M208_report(); } @@ -68,7 +68,7 @@ void GcodeSuite::M208_report(const bool forReplay/*=true*/) { void GcodeSuite::M209() { fwretract.M209(); } void GcodeSuite::M209_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_AUTO_RETRACT_S)); + report_heading_etc(forReplay, F(STR_AUTO_RETRACT_S)); fwretract.M209_report(); } diff --git a/Marlin/src/gcode/feature/pause/M603.cpp b/Marlin/src/gcode/feature/pause/M603.cpp index ebb110d2e7..6689749cfb 100644 --- a/Marlin/src/gcode/feature/pause/M603.cpp +++ b/Marlin/src/gcode/feature/pause/M603.cpp @@ -65,7 +65,7 @@ void GcodeSuite::M603() { } void GcodeSuite::M603_report(const bool forReplay/*=true*/) { - report_heading(forReplay, PSTR(STR_FILAMENT_LOAD_UNLOAD)); + report_heading(forReplay, F(STR_FILAMENT_LOAD_UNLOAD)); #if EXTRUDERS == 1 report_echo_start(forReplay); diff --git a/Marlin/src/gcode/feature/powerloss/M413.cpp b/Marlin/src/gcode/feature/powerloss/M413.cpp index 9bf109559f..e02bd4bd95 100644 --- a/Marlin/src/gcode/feature/powerloss/M413.cpp +++ b/Marlin/src/gcode/feature/powerloss/M413.cpp @@ -57,7 +57,7 @@ void GcodeSuite::M413() { } void GcodeSuite::M413_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_POWER_LOSS_RECOVERY)); + report_heading_etc(forReplay, F(STR_POWER_LOSS_RECOVERY)); SERIAL_ECHOPGM(" M413 S", AS_DIGIT(recovery.enabled), " ; "); serialprintln_onoff(recovery.enabled); } diff --git a/Marlin/src/gcode/feature/runout/M412.cpp b/Marlin/src/gcode/feature/runout/M412.cpp index 9cbfbade66..bcf1e9f1b1 100644 --- a/Marlin/src/gcode/feature/runout/M412.cpp +++ b/Marlin/src/gcode/feature/runout/M412.cpp @@ -67,7 +67,7 @@ void GcodeSuite::M412() { } void GcodeSuite::M412_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_FILAMENT_RUNOUT_SENSOR)); + report_heading_etc(forReplay, F(STR_FILAMENT_RUNOUT_SENSOR)); SERIAL_ECHOPGM( " M412 S", runout.enabled #if HAS_FILAMENT_RUNOUT_DISTANCE diff --git a/Marlin/src/gcode/feature/trinamic/M569.cpp b/Marlin/src/gcode/feature/trinamic/M569.cpp index 00aadd4756..959fc16e67 100644 --- a/Marlin/src/gcode/feature/trinamic/M569.cpp +++ b/Marlin/src/gcode/feature/trinamic/M569.cpp @@ -139,7 +139,7 @@ void GcodeSuite::M569() { } void GcodeSuite::M569_report(const bool forReplay/*=true*/) { - report_heading(forReplay, PSTR(STR_DRIVER_STEPPING_MODE)); + report_heading(forReplay, F(STR_DRIVER_STEPPING_MODE)); auto say_M569 = [](const bool forReplay, const char * const etc=nullptr, const bool eol=false) { if (!forReplay) SERIAL_ECHO_START(); diff --git a/Marlin/src/gcode/feature/trinamic/M906.cpp b/Marlin/src/gcode/feature/trinamic/M906.cpp index c3e12a4f92..f28718c831 100644 --- a/Marlin/src/gcode/feature/trinamic/M906.cpp +++ b/Marlin/src/gcode/feature/trinamic/M906.cpp @@ -199,7 +199,7 @@ void GcodeSuite::M906() { } void GcodeSuite::M906_report(const bool forReplay/*=true*/) { - report_heading(forReplay, PSTR(STR_STEPPER_DRIVER_CURRENT)); + report_heading(forReplay, F(STR_STEPPER_DRIVER_CURRENT)); auto say_M906 = [](const bool forReplay) { report_echo_start(forReplay); diff --git a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp index f15343484a..3f83558fd4 100644 --- a/Marlin/src/gcode/feature/trinamic/M911-M914.cpp +++ b/Marlin/src/gcode/feature/trinamic/M911-M914.cpp @@ -311,7 +311,7 @@ } void GcodeSuite::M913_report(const bool forReplay/*=true*/) { - report_heading(forReplay, PSTR(STR_HYBRID_THRESHOLD)); + report_heading(forReplay, F(STR_HYBRID_THRESHOLD)); auto say_M913 = [](const bool forReplay) { report_echo_start(forReplay); @@ -512,7 +512,7 @@ } void GcodeSuite::M914_report(const bool forReplay/*=true*/) { - report_heading(forReplay, PSTR(STR_STALLGUARD_THRESHOLD)); + report_heading(forReplay, F(STR_STALLGUARD_THRESHOLD)); auto say_M914 = [](const bool forReplay) { report_echo_start(forReplay); diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index e23315e9f5..e05a5f236a 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -103,12 +103,12 @@ axis_bits_t GcodeSuite::axis_relative = 0 LOGICAL_AXIS_GANG( #endif void GcodeSuite::report_echo_start(const bool forReplay) { if (!forReplay) SERIAL_ECHO_START(); } -void GcodeSuite::report_heading(const bool forReplay, PGM_P const pstr, const bool eol/*=true*/) { +void GcodeSuite::report_heading(const bool forReplay, FSTR_P const fstr, const bool eol/*=true*/) { if (forReplay) return; - if (pstr) { + if (fstr) { SERIAL_ECHO_START(); SERIAL_ECHOPGM("; "); - SERIAL_ECHOPGM_P(pstr); + SERIAL_ECHOF(fstr); } if (eol) { SERIAL_CHAR(':'); SERIAL_EOL(); } } diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 0106f002c2..5ad4750fe4 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -382,9 +382,9 @@ public: } static void report_echo_start(const bool forReplay); - static void report_heading(const bool forReplay, PGM_P const pstr, const bool eol=true); - static inline void report_heading_etc(const bool forReplay, PGM_P const pstr, const bool eol=true) { - report_heading(forReplay, pstr, eol); + static void report_heading(const bool forReplay, FSTR_P const fstr, const bool eol=true); + static inline void report_heading_etc(const bool forReplay, FSTR_P const fstr, const bool eol=true) { + report_heading(forReplay, fstr, eol); report_echo_start(forReplay); } static void say_units(); diff --git a/Marlin/src/gcode/geometry/M206_M428.cpp b/Marlin/src/gcode/geometry/M206_M428.cpp index 8dba238d09..131dbecf33 100644 --- a/Marlin/src/gcode/geometry/M206_M428.cpp +++ b/Marlin/src/gcode/geometry/M206_M428.cpp @@ -53,7 +53,7 @@ void GcodeSuite::M206() { } void GcodeSuite::M206_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_HOME_OFFSET)); + report_heading_etc(forReplay, F(STR_HOME_OFFSET)); SERIAL_ECHOLNPGM_P( #if IS_CARTESIAN LIST_N(DOUBLE(LINEAR_AXES), diff --git a/Marlin/src/gcode/lcd/M145.cpp b/Marlin/src/gcode/lcd/M145.cpp index 77fd425763..2dba238d3f 100644 --- a/Marlin/src/gcode/lcd/M145.cpp +++ b/Marlin/src/gcode/lcd/M145.cpp @@ -61,7 +61,7 @@ void GcodeSuite::M145() { } void GcodeSuite::M145_report(const bool forReplay/*=true*/) { - report_heading(forReplay, PSTR(STR_MATERIAL_HEATUP)); + report_heading(forReplay, F(STR_MATERIAL_HEATUP)); LOOP_L_N(i, PREHEAT_COUNT) { report_echo_start(forReplay); SERIAL_ECHOLNPGM_P( diff --git a/Marlin/src/gcode/lcd/M250.cpp b/Marlin/src/gcode/lcd/M250.cpp index 083fb37f65..25e4232788 100644 --- a/Marlin/src/gcode/lcd/M250.cpp +++ b/Marlin/src/gcode/lcd/M250.cpp @@ -38,7 +38,7 @@ void GcodeSuite::M250() { } void GcodeSuite::M250_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_LCD_CONTRAST)); + report_heading_etc(forReplay, F(STR_LCD_CONTRAST)); SERIAL_ECHOLNPGM(" M250 C", ui.contrast); } diff --git a/Marlin/src/gcode/lcd/M256.cpp b/Marlin/src/gcode/lcd/M256.cpp index ee187cc2e1..9842cc2583 100644 --- a/Marlin/src/gcode/lcd/M256.cpp +++ b/Marlin/src/gcode/lcd/M256.cpp @@ -37,7 +37,7 @@ void GcodeSuite::M256() { } void GcodeSuite::M256_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_LCD_BRIGHTNESS)); + report_heading_etc(forReplay, F(STR_LCD_BRIGHTNESS)); SERIAL_ECHOLNPGM(" M256 B", ui.brightness); } diff --git a/Marlin/src/gcode/lcd/M414.cpp b/Marlin/src/gcode/lcd/M414.cpp index 0eac980e0f..9aa49ea3c2 100644 --- a/Marlin/src/gcode/lcd/M414.cpp +++ b/Marlin/src/gcode/lcd/M414.cpp @@ -44,7 +44,7 @@ void GcodeSuite::M414() { } void GcodeSuite::M414_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_UI_LANGUAGE)); + report_heading_etc(forReplay, F(STR_UI_LANGUAGE)); SERIAL_ECHOLNPGM(" M414 S", ui.language); } diff --git a/Marlin/src/gcode/probe/M851.cpp b/Marlin/src/gcode/probe/M851.cpp index 7ec326730f..e66392acb4 100644 --- a/Marlin/src/gcode/probe/M851.cpp +++ b/Marlin/src/gcode/probe/M851.cpp @@ -84,7 +84,7 @@ void GcodeSuite::M851() { } void GcodeSuite::M851_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_Z_PROBE_OFFSET)); + report_heading_etc(forReplay, F(STR_Z_PROBE_OFFSET)); SERIAL_ECHOPGM_P( #if HAS_PROBE_XY_OFFSET PSTR(" M851 X"), LINEAR_UNIT(probe.offset_xy.x), diff --git a/Marlin/src/gcode/units/M149.cpp b/Marlin/src/gcode/units/M149.cpp index b1cfbb2511..3f1ea3654e 100644 --- a/Marlin/src/gcode/units/M149.cpp +++ b/Marlin/src/gcode/units/M149.cpp @@ -37,7 +37,7 @@ void GcodeSuite::M149() { } void GcodeSuite::M149_report(const bool forReplay/*=true*/) { - report_heading_etc(forReplay, PSTR(STR_TEMPERATURE_UNITS)); + report_heading_etc(forReplay, F(STR_TEMPERATURE_UNITS)); SERIAL_ECHOPGM(" M149 ", AS_CHAR(parser.temp_units_code()), " ; Units in "); SERIAL_ECHOLNF(parser.temp_units_name()); } diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index 4f15dceba8..6b7143e82a 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -3037,7 +3037,7 @@ void MarlinSettings::reset() { #define CONFIG_ECHO_START() gcode.report_echo_start(forReplay) #define CONFIG_ECHO_MSG(V...) do{ CONFIG_ECHO_START(); SERIAL_ECHOLNPGM(V); }while(0) #define CONFIG_ECHO_MSG_P(V...) do{ CONFIG_ECHO_START(); SERIAL_ECHOLNPGM_P(V); }while(0) - #define CONFIG_ECHO_HEADING(STR) gcode.report_heading(forReplay, PSTR(STR)) + #define CONFIG_ECHO_HEADING(STR) gcode.report_heading(forReplay, F(STR)) void M92_report(const bool echo=true, const int8_t e=-1); diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index aa81ea5d96..a3ada25118 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -1727,7 +1727,7 @@ void Temperature::manage_heater() { } void Temperature::M305_report(const uint8_t t_index, const bool forReplay/*=true*/) { - gcode.report_heading_etc(forReplay, PSTR(STR_USER_THERMISTORS)); + gcode.report_heading_etc(forReplay, F(STR_USER_THERMISTORS)); SERIAL_ECHOPGM(" M305 P", AS_DIGIT(t_index)); const user_thermistor_t &t = user_thermistor[t_index];