Skip to content

Commit b02c839

Browse files
committed
pico: Update forceStop & getCurrentPosition to use stepper_make_fifo_entry instead of hardcoded shift (#327)
1 parent 6c7e882 commit b02c839

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/StepperISR_rp_pico.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void StepperQueue::forceStop() {
134134
pio_sm_clear_fifos(pio, sm);
135135
pio_sm_restart(pio, sm);
136136
// ensure step is zero
137-
uint32_t entry = (1 << 10) | (0) | 0;
137+
uint32_t entry = stepper_make_fifo_entry(queue_end.dir, 0, 0, 1); // no steps and 1us cycleAA
138138
pio_sm_put(pio, sm, entry);
139139
}
140140
bool StepperQueue::isRunning() {
@@ -153,7 +153,7 @@ int32_t StepperQueue::getCurrentPosition() {
153153
}
154154
if (!isRunning()) {
155155
// kick off loop to probe position
156-
uint32_t entry = (1 << 10) | (0) | 0;
156+
uint32_t entry = stepper_make_fifo_entry(queue_end.dir, 0, 0, 1); // no steps and 1us cycleAA
157157
pio_sm_put(pio, sm, entry);
158158
}
159159
// just need to wait a while for next value

0 commit comments

Comments
 (0)