Skip to content

Commit

Permalink
Run background tasks before non-dma transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
gamblor21 committed Feb 7, 2021
1 parent 90e4bfb commit b1f96e1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ports/raspberrypi/common-hal/rp2pio/StateMachine.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ static bool _transfer(rp2pio_statemachine_obj_t *self,
size_t rx_remaining = in_len;
size_t tx_remaining = out_len;

RUN_BACKGROUND_TASKS; // clear any pending tasks before writing the small number of bytes
while (rx_remaining || tx_remaining) {
if (tx_remaining && !pio_sm_is_tx_fifo_full(self->pio, self->state_machine)) {
*tx_destination = *data_out;
Expand Down

0 comments on commit b1f96e1

Please sign in to comment.