From 107cc1f6a1cef0e32d9f7e739cb0b91027221b5b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 18 Mar 2021 00:11:06 -0500 Subject: [PATCH] Followup to planner cleanup --- Marlin/src/module/planner.cpp | 10 +++++----- Marlin/src/module/planner.h | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Marlin/src/module/planner.cpp b/Marlin/src/module/planner.cpp index c60e9f6cd..594671f87 100644 --- a/Marlin/src/module/planner.cpp +++ b/Marlin/src/module/planner.cpp @@ -3029,7 +3029,7 @@ inline void limit_and_warn(float &val, const uint8_t axis, PGM_P const setting_n * * This hard limit is applied as a block is being added to the planner queue. */ -void Planner::set_max_acceleration(const uint8_t axis, const float &inMaxAccelMMS2) { +void Planner::set_max_acceleration(const uint8_t axis, float inMaxAccelMMS2) { #if ENABLED(LIMITED_MAX_ACCEL_EDITING) #ifdef MAX_ACCEL_EDIT_VALUES constexpr xyze_float_t max_accel_edit = MAX_ACCEL_EDIT_VALUES; @@ -3052,7 +3052,7 @@ void Planner::set_max_acceleration(const uint8_t axis, const float &inMaxAccelMM * * This hard limit is applied as a block is being added to the planner queue. */ -void Planner::set_max_feedrate(const uint8_t axis, const float &inMaxFeedrateMMS) { +void Planner::set_max_feedrate(const uint8_t axis, float inMaxFeedrateMMS) { #if ENABLED(LIMITED_MAX_FR_EDITING) #ifdef MAX_FEEDRATE_EDIT_VALUES constexpr xyze_float_t max_fr_edit = MAX_FEEDRATE_EDIT_VALUES; @@ -3074,7 +3074,7 @@ void Planner::set_max_feedrate(const uint8_t axis, const float &inMaxFeedrateMMS * * This hard limit is applied (to the block start speed) as the block is being added to the planner queue. */ - void Planner::set_max_jerk(const AxisEnum axis, const float &targetValue) { + void Planner::set_max_jerk(const AxisEnum axis, float inMaxJerkMMS) { #if ENABLED(LIMITED_JERK_EDITING) constexpr xyze_float_t max_jerk_edit = #ifdef MAX_JERK_EDIT_VALUES @@ -3084,9 +3084,9 @@ void Planner::set_max_feedrate(const uint8_t axis, const float &inMaxFeedrateMMS (DEFAULT_ZJERK) * 2, (DEFAULT_EJERK) * 2 } #endif ; - limit_and_warn(targetValue, axis, PSTR("Jerk"), max_jerk_edit); + limit_and_warn(inMaxJerkMMS, axis, PSTR("Jerk"), max_jerk_edit); #endif - max_jerk[axis] = targetValue; + max_jerk[axis] = inMaxJerkMMS; } #endif diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index a7aabd9d6..7ebba1e34 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -470,14 +470,14 @@ class Planner { static void refresh_positioning(); // For an axis set the Maximum Acceleration in mm/s^2 - static void set_max_acceleration(const uint8_t axis, const float &inMaxAccelMMS2); + static void set_max_acceleration(const uint8_t axis, float inMaxAccelMMS2); // For an axis set the Maximum Feedrate in mm/s - static void set_max_feedrate(const uint8_t axis, const float &inMaxFeedrateMMS); + static void set_max_feedrate(const uint8_t axis, float inMaxFeedrateMMS); // For an axis set the Maximum Jerk (instant change) in mm/s #if HAS_CLASSIC_JERK - static void set_max_jerk(const AxisEnum axis, const float &inMaxJerkMMS); + static void set_max_jerk(const AxisEnum axis, float inMaxJerkMMS); #else static inline void set_max_jerk(const AxisEnum, const float&) {} #endif