summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Epler <jeff@adafruit.com>2021-02-26 09:47:19 -0600
committerGitHub <noreply@github.com>2021-02-26 09:47:19 -0600
commit5158aec8c190757df000388a05b6006bd32629a7 (patch)
tree42816832a32bd1c56530c30de4a0d5b7a970ac85
parentb69cb0144ca0d54011be540213d1e25e673a63de (diff)
parent22276710e67884af3fc64eae1f35173a91ce96ca (diff)
Merge pull request #4269 from jepler/fix-out-stride-2-4
rp2pio: Fix writing where the stride was 2 or 4
-rw-r--r--ports/raspberrypi/common-hal/rp2pio/StateMachine.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c
index 5973f47a2..7d2385064 100644
--- a/ports/raspberrypi/common-hal/rp2pio/StateMachine.c
+++ b/ports/raspberrypi/common-hal/rp2pio/StateMachine.c
@@ -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;