* Recalculate 'position' and 'mm_per_step'. * Must be called whenever settings.axis_steps_per_mm changes! */
| 3252 | * Must be called whenever settings.axis_steps_per_mm changes! |
| 3253 | */ |
| 3254 | void 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 |
| 3267 | inline void limit_and_warn(float &val, const AxisEnum axis, FSTR_P const setting_name, const xyze_float_t &max_limit) { |
no test coverage detected