From 1f1ca34ea6c37d8d22808f3fb25992776abfe4f2 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 15 Jan 2024 22:22:08 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Tweak=20lim?= =?UTF-8?q?it=5Fand=5Fwarn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/module/planner.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index 14cc06419e..6371a960a7 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -3320,16 +3320,12 @@ void Planner::refresh_positioning() { } // Apply limits to a variable and give a warning if the value was out of range -inline void limit_and_warn(float &val, const AxisEnum axis, PGM_P const setting_name, const xyze_float_t &max_limit) { +inline void limit_and_warn(float &val, const AxisEnum axis, FSTR_P const setting_name, const xyze_float_t &max_limit) { const uint8_t lim_axis = TERN_(HAS_EXTRUDERS, axis > E_AXIS ? E_AXIS :) axis; const float before = val; LIMIT(val, 0.1f, max_limit[lim_axis]); - if (before != val) { - SERIAL_CHAR(AXIS_CHAR(lim_axis)); - SERIAL_ECHOPGM(" Max "); - SERIAL_ECHOPGM_P(setting_name); - SERIAL_ECHOLNPGM(" limited to ", val); - } + if (before != val) + SERIAL_ECHOLN(C(AXIS_CHAR(lim_axis)), F(" Max "), setting_name, F(" limited to "), val); } /** @@ -3348,7 +3344,7 @@ void Planner::set_max_acceleration(const AxisEnum axis, float inMaxAccelMMS2) { constexpr xyze_float_t max_accel_edit = DEFAULT_MAX_ACCELERATION; const xyze_float_t max_acc_edit_scaled = max_accel_edit * 2; #endif - limit_and_warn(inMaxAccelMMS2, axis, PSTR("Acceleration"), max_acc_edit_scaled); + limit_and_warn(inMaxAccelMMS2, axis, F("Acceleration"), max_acc_edit_scaled); #endif settings.max_acceleration_mm_per_s2[axis] = inMaxAccelMMS2; @@ -3371,7 +3367,7 @@ void Planner::set_max_feedrate(const AxisEnum axis, float inMaxFeedrateMMS) { constexpr xyze_float_t max_fr_edit = DEFAULT_MAX_FEEDRATE; const xyze_float_t max_fr_edit_scaled = max_fr_edit * 2; #endif - limit_and_warn(inMaxFeedrateMMS, axis, PSTR("Feedrate"), max_fr_edit_scaled); + limit_and_warn(inMaxFeedrateMMS, axis, F("Feedrate"), max_fr_edit_scaled); #endif settings.max_feedrate_mm_s[axis] = inMaxFeedrateMMS; } @@ -3394,7 +3390,7 @@ void Planner::set_max_feedrate(const AxisEnum axis, float inMaxFeedrateMMS) { (DEFAULT_ZJERK) * 2, (DEFAULT_EJERK) * 2 } #endif ; - limit_and_warn(inMaxJerkMMS, axis, PSTR("Jerk"), max_jerk_edit); + limit_and_warn(inMaxJerkMMS, axis, F("Jerk"), max_jerk_edit); #endif max_jerk[axis] = inMaxJerkMMS; }