MCPcopy Create free account
hub / github.com/MarlinFirmware/Marlin / refresh_positioning

Method refresh_positioning

Marlin/src/module/planner.cpp:3254–3264  ·  view source on GitHub ↗

* Recalculate 'position' and 'mm_per_step'. * Must be called whenever settings.axis_steps_per_mm changes! */

Source from the content-addressed store, hash-verified

3252 * Must be called whenever settings.axis_steps_per_mm changes!
3253 */
3254void Planner::refresh_positioning() {
3255 #if ENABLED(EDITABLE_STEPS_PER_UNIT)
3256 LOOP_DISTINCT_AXES(i) mm_per_step[i] = 1.0f / settings.axis_steps_per_mm[i];
3257 #if ALL(NONLINEAR_EXTRUSION, SMOOTH_LIN_ADVANCE)
3258 stepper.ne.q30.A = _BV32(30) * (stepper.ne.settings.coeff.A * mm_per_step[E_AXIS_N(0)] * mm_per_step[E_AXIS_N(0)]);
3259 stepper.ne.q30.B = _BV32(30) * (stepper.ne.settings.coeff.B * mm_per_step[E_AXIS_N(0)]);
3260 #endif
3261 #endif
3262 set_position_mm(current_position);
3263 refresh_acceleration_rates();
3264}
3265
3266// Apply limits to a variable and give a warning if the value was out of range
3267inline void limit_and_warn(float &val, const AxisEnum axis, FSTR_P const setting_name, const xyze_float_t &max_limit) {

Callers 5

postprocessMethod · 0.80
M92Method · 0.80
setAxisSteps_per_mmFunction · 0.80
set_value_confirmFunction · 0.80

Calls 1

LOOP_DISTINCT_AXESFunction · 0.70

Tested by

no test coverage detected