mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-08-08 06:24:03 -06:00
stepcompress: Merge stepcompress_push_accel() and stepcompress_push_const()
It's not necessary to have separate C functions for constant acceleration and constant velocity as constant velocity can be obtained by using a constant acceleration of zero. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
1d81bf5596
commit
98add22891
6 changed files with 48 additions and 82 deletions
|
@ -169,22 +169,22 @@ class PrinterExtruder:
|
|||
|
||||
# Acceleration steps
|
||||
if accel_d:
|
||||
mcu_stepper.step_accel(mcu_time, start_pos, accel_d, start_v, accel)
|
||||
mcu_stepper.step_const(mcu_time, start_pos, accel_d, start_v, accel)
|
||||
start_pos += accel_d
|
||||
mcu_time += accel_t
|
||||
# Cruising steps
|
||||
if cruise_d:
|
||||
mcu_stepper.step_const(mcu_time, start_pos, cruise_d, cruise_v)
|
||||
mcu_stepper.step_const(mcu_time, start_pos, cruise_d, cruise_v, 0.)
|
||||
start_pos += cruise_d
|
||||
mcu_time += cruise_t
|
||||
# Deceleration steps
|
||||
if decel_d:
|
||||
mcu_stepper.step_accel(mcu_time, start_pos, decel_d, decel_v, -accel)
|
||||
mcu_stepper.step_const(mcu_time, start_pos, decel_d, decel_v, -accel)
|
||||
start_pos += decel_d
|
||||
mcu_time += decel_t
|
||||
# Retraction steps
|
||||
if retract_d:
|
||||
mcu_stepper.step_accel(
|
||||
mcu_stepper.step_const(
|
||||
mcu_time, start_pos, -retract_d, retract_v, accel)
|
||||
start_pos -= retract_d
|
||||
self.extrude_pos = start_pos
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue