Merge pull request #4269 from jepler/fix-out-stride-2-4

rp2pio: Fix writing where the stride was 2 or 4
This commit is contained in:
Jeff Epler 2021-02-26 09:47:19 -06:00 committed by GitHub
commit 5158aec8c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -640,9 +640,9 @@ static bool _transfer(rp2pio_statemachine_obj_t *self,
while (tx_remaining && !pio_sm_is_tx_fifo_full(self->pio, self->state_machine)) {
if (out_stride_in_bytes == 1) {
*tx_destination = *data_out;
} else if (in_stride_in_bytes == 2) {
} else if (out_stride_in_bytes == 2) {
*((uint16_t*) tx_destination) = *((uint16_t*) data_out);
} else if (in_stride_in_bytes == 4) {
} else if (out_stride_in_bytes == 4) {
*((uint32_t*) tx_destination) = *((uint32_t*) data_out);
}
data_out += out_stride_in_bytes;