From a3c00d0bed759cacd73fa4160029b009e17da87e Mon Sep 17 00:00:00 2001 From: Dmitry Butyugin Date: Wed, 19 Apr 2023 22:57:39 +0200 Subject: [PATCH] input_shaper: Correctly initialize input shaper stepper_kinematics If the stepper already executed some steps with the basic stepper_kinematics, subsequent creation of a new one for input_shaper would result in stepcompress errors unless position and time tracking flags are also copied over. Signed-off-by: Dmitry Butyugin --- klippy/chelper/kin_shaper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/klippy/chelper/kin_shaper.c b/klippy/chelper/kin_shaper.c index dd9cf619..8c26e9a2 100644 --- a/klippy/chelper/kin_shaper.c +++ b/klippy/chelper/kin_shaper.c @@ -171,6 +171,9 @@ input_shaper_set_sk(struct stepper_kinematics *sk return -1; is->sk.active_flags = orig_sk->active_flags; is->orig_sk = orig_sk; + is->sk.commanded_pos = orig_sk->commanded_pos; + is->sk.last_flush_time = orig_sk->last_flush_time; + is->sk.last_move_time = orig_sk->last_move_time; return 0; }