diff options
author | Dmitry Butyugin <dmbutyugin@google.com> | 2025-03-02 01:45:57 +0100 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2025-03-11 19:15:23 -0400 |
commit | 47aa28e5300d75764add52e34b23b1804147626c (patch) | |
tree | 42fe288bf0c8d7ea07cf10a541d505de95e79d35 /klippy/chelper/kin_shaper.c | |
parent | fbd5b492157e9b631c42a0ffa164da0a26120fcb (diff) | |
download | kutter-47aa28e5300d75764add52e34b23b1804147626c.tar.gz kutter-47aa28e5300d75764add52e34b23b1804147626c.tar.xz kutter-47aa28e5300d75764add52e34b23b1804147626c.zip |
input_shaper: Fix for polar kinematics
Forward post_cb calls from itersolve to the original kinematics.
Signed-off-by: Dmitry Butyugin <dmbutyugin@google.com>
Diffstat (limited to 'klippy/chelper/kin_shaper.c')
-rw-r--r-- | klippy/chelper/kin_shaper.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/klippy/chelper/kin_shaper.c b/klippy/chelper/kin_shaper.c index 18d14143..acdd1ccc 100644 --- a/klippy/chelper/kin_shaper.c +++ b/klippy/chelper/kin_shaper.c @@ -156,6 +156,16 @@ shaper_xy_calc_position(struct stepper_kinematics *sk, struct move *m return is->orig_sk->calc_position_cb(is->orig_sk, &is->m, DUMMY_T); } +// A callback that forwards post_cb call to the original kinematics +static void +shaper_commanded_pos_post_fixup(struct stepper_kinematics *sk) +{ + struct input_shaper *is = container_of(sk, struct input_shaper, sk); + is->orig_sk->commanded_pos = sk->commanded_pos; + is->orig_sk->post_cb(is->orig_sk); + sk->commanded_pos = is->orig_sk->commanded_pos; +} + int __visible input_shaper_set_sk(struct stepper_kinematics *sk , struct stepper_kinematics *orig_sk) @@ -174,6 +184,9 @@ input_shaper_set_sk(struct stepper_kinematics *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; + if (orig_sk->post_cb) { + is->sk.post_cb = shaper_commanded_pos_post_fixup; + } return 0; } |