Skip to content

Commit 902824d

Browse files
jbr7rrkartben
authored andcommitted
drivers: stepper: Fix stepper callbacks when using work_q
Fix issue where stepper callbacks were not being called when using work_q. This was due to the steps being counted down before the work_q was rescheduled. Signed-off-by: Josselin Bunt <josselin@sensible.health>
1 parent 96325ad commit 902824d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/stepper/step_dir/step_dir_stepper_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ static void position_mode_task(const struct device *dev)
145145
(void)step_dir_stepper_perform_step(dev);
146146
}
147147

148-
update_remaining_steps(dev->data);
149-
150148
if (config->timing_source->needs_reschedule(dev) && data->step_count != 0) {
151149
(void)config->timing_source->start(dev);
152150
}
151+
152+
update_remaining_steps(dev->data);
153153
}
154154

155155
static void velocity_mode_task(const struct device *dev)

0 commit comments

Comments
 (0)