♻️ reset_acceleration_rates => refresh_…

This commit is contained in:
Scott Lahteine
2022-06-26 22:30:05 -05:00
parent 05bdc5640d
commit 57c137a60f
5 changed files with 13 additions and 13 deletions

View File

@ -1557,7 +1557,7 @@ void Planner::check_axes_activity() {
TERN_(DELTA, settings.max_acceleration_mm_per_s2[Z_AXIS] = saved_motion_state.acceleration.z);
TERN_(HAS_CLASSIC_JERK, max_jerk = saved_motion_state.jerk_state);
}
reset_acceleration_rates();
refresh_acceleration_rates();
}
#endif
@ -3267,7 +3267,7 @@ void Planner::set_position_mm(const xyze_pos_t &xyze) {
* - acceleration_long_cutoff based on the largest max_acceleration_steps_per_s2 (M201)
* - max_e_jerk for all extruders based on junction_deviation_mm (M205 J)
*/
void Planner::reset_acceleration_rates() {
void Planner::refresh_acceleration_rates() {
uint32_t highest_rate = 1;
LOOP_DISTINCT_AXES(i) {
max_acceleration_steps_per_s2[i] = settings.max_acceleration_mm_per_s2[i] * settings.axis_steps_per_mm[i];
@ -3285,7 +3285,7 @@ void Planner::reset_acceleration_rates() {
void Planner::refresh_positioning() {
LOOP_DISTINCT_AXES(i) mm_per_step[i] = 1.0f / settings.axis_steps_per_mm[i];
set_position_mm(current_position);
reset_acceleration_rates();
refresh_acceleration_rates();
}
// Apply limits to a variable and give a warning if the value was out of range
@ -3304,7 +3304,7 @@ inline void limit_and_warn(float &val, const AxisEnum axis, PGM_P const setting_
/**
* For the specified 'axis' set the Maximum Acceleration to the given value (mm/s^2)
* The value may be limited with warning feedback, if configured.
* Calls reset_acceleration_rates to precalculate planner terms in steps.
* Calls refresh_acceleration_rates to precalculate planner terms in steps.
*
* This hard limit is applied as a block is being added to the planner queue.
*/
@ -3322,7 +3322,7 @@ void Planner::set_max_acceleration(const AxisEnum axis, float inMaxAccelMMS2) {
settings.max_acceleration_mm_per_s2[axis] = inMaxAccelMMS2;
// Update steps per s2 to agree with the units per s2 (since they are used in the planner)
reset_acceleration_rates();
refresh_acceleration_rates();
}
/**

View File

@ -514,7 +514,7 @@ class Planner {
*/
// Recalculate steps/s^2 accelerations based on mm/s^2 settings
static void reset_acceleration_rates();
static void refresh_acceleration_rates();
/**
* Recalculate 'position' and 'mm_per_step'.

View File

@ -592,7 +592,7 @@ void MarlinSettings::postprocess() {
xyze_pos_t oldpos = current_position;
// steps per s2 needs to be updated to agree with units per s2
planner.reset_acceleration_rates();
planner.refresh_acceleration_rates();
// Make sure delta kinematics are updated before refreshing the
// planner position so the stepper counts will be set correctly.