diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2020-08-30 12:04:54 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2020-08-30 12:32:11 -0400 |
commit | a7defdcad0306acb75c84f0d2ba65a726812dfd9 (patch) | |
tree | bc232b02548267d738500ab30971f672ef6271f5 /klippy/chelper/kin_shaper.c | |
parent | 08ddf25cf36e14731cffa668bcc5206f87ea445e (diff) | |
download | kutter-a7defdcad0306acb75c84f0d2ba65a726812dfd9.tar.gz kutter-a7defdcad0306acb75c84f0d2ba65a726812dfd9.tar.xz kutter-a7defdcad0306acb75c84f0d2ba65a726812dfd9.zip |
kin_shaper: Fix check for optimized X or Y only calculations
The optimized version is only available if it's the only axis used.
This fixes input_shaper on corexz.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/chelper/kin_shaper.c')
-rw-r--r-- | klippy/chelper/kin_shaper.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/klippy/chelper/kin_shaper.c b/klippy/chelper/kin_shaper.c index 0d62ada0..f71650f1 100644 --- a/klippy/chelper/kin_shaper.c +++ b/klippy/chelper/kin_shaper.c @@ -332,13 +332,12 @@ input_shaper_set_sk(struct stepper_kinematics *sk , struct stepper_kinematics *orig_sk) { struct input_shaper *is = container_of(sk, struct input_shaper, sk); - int af = orig_sk->active_flags & (AF_X | AF_Y); - if (af == (AF_X | AF_Y)) - is->sk.calc_position_cb = shaper_xy_calc_position; - else if (af & AF_X) + if (orig_sk->active_flags == AF_X) is->sk.calc_position_cb = shaper_x_calc_position; - else if (af & AF_Y) + else if (orig_sk->active_flags == AF_Y) is->sk.calc_position_cb = shaper_y_calc_position; + else if (orig_sk->active_flags & (AF_X | AF_Y)) + is->sk.calc_position_cb = shaper_xy_calc_position; else return -1; is->sk.active_flags = orig_sk->active_flags; |