Browse Source

Followup to planner cleanup

vanilla_fb_2.0.x
Scott Lahteine 4 years ago
parent
commit
ad907a51e2
  1. 10
      Marlin/src/module/planner.cpp
  2. 6
      Marlin/src/module/planner.h

10
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. * 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) #if ENABLED(LIMITED_MAX_ACCEL_EDITING)
#ifdef MAX_ACCEL_EDIT_VALUES #ifdef MAX_ACCEL_EDIT_VALUES
constexpr xyze_float_t max_accel_edit = 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. * 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) #if ENABLED(LIMITED_MAX_FR_EDITING)
#ifdef MAX_FEEDRATE_EDIT_VALUES #ifdef MAX_FEEDRATE_EDIT_VALUES
constexpr xyze_float_t max_fr_edit = 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. * 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) #if ENABLED(LIMITED_JERK_EDITING)
constexpr xyze_float_t max_jerk_edit = constexpr xyze_float_t max_jerk_edit =
#ifdef MAX_JERK_EDIT_VALUES #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 } (DEFAULT_ZJERK) * 2, (DEFAULT_EJERK) * 2 }
#endif #endif
; ;
limit_and_warn(targetValue, axis, PSTR("Jerk"), max_jerk_edit); limit_and_warn(inMaxJerkMMS, axis, PSTR("Jerk"), max_jerk_edit);
#endif #endif
max_jerk[axis] = targetValue; max_jerk[axis] = inMaxJerkMMS;
} }
#endif #endif

6
Marlin/src/module/planner.h

@ -470,14 +470,14 @@ class Planner {
static void refresh_positioning(); static void refresh_positioning();
// For an axis set the Maximum Acceleration in mm/s^2 // 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 // 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 // For an axis set the Maximum Jerk (instant change) in mm/s
#if HAS_CLASSIC_JERK #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 #else
static inline void set_max_jerk(const AxisEnum, const float&) {} static inline void set_max_jerk(const AxisEnum, const float&) {}
#endif #endif

Loading…
Cancel
Save