8000 address review comments · JetForMe/circuitpython@5553678 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5553678

Browse files
committed
address review comments
1 parent 8377a74 commit 5553678

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

ports/raspberrypi/bindings/rp2pio/StateMachine.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_write_obj, 2, rp2pio_statemachine
496496
//| once: Optional[ReadableBuffer] = None,
497497
//| *,
498498
//| loop: Optional[ReadableBuffer] = None,
499+
//| loop2: Optional[ReadableBuffer] = None,
499500
//| swap: bool = False,
500501
//| ) -> None:
501502
//| """Write data to the TX fifo in the background, with optional looping.
@@ -504,8 +505,8 @@ MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_write_obj, 2, rp2pio_statemachine
504505
//| This means that any ``once`` or ``loop`` buffer will be written at least once.
505506
//| Then the ``once`` and/or ``loop`` buffers are queued. and the function returns.
506507
//| The ``once`` buffer (if specified) will be written just once.
507-
//| Finally, the ``loop`` buffer (if specified) will continue being looped indefinitely.
508-
//|
508+
//| Finally, the ``loop`` and/or ``loop2`` buffer (if specified) will continue being looped indefinitely. If both ``loop`` and ``loop2`` are specified, they will alternate.
509+
//|
509510
//| Writes to the FIFO will match the input buffer's element size. For example, bytearray elements
510511
//| will perform 8 bit writes to the PIO FIFO. The RP2040's memory bus will duplicate the value into
511512
//| the other byte positions. So, pulling more data in the PIO assembly will read the duplicated values.
@@ -531,6 +532,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(rp2pio_statemachine_write_obj, 2, rp2pio_statemachine
531532
//|
532533
//| :param ~Optional[circuitpython_typing.ReadableBuffer] once: Data to be written once
533534
//| :param ~Optional[circuitpython_typing.ReadableBuffer] loop: Data to be written repeatedly
535+
//| :param ~Optional[circuitpython_typing.ReadableBuffer] loop2: Data to be written repeatedly
534536
//| :param bool swap: For 2- and 4-byte elements, swap (reverse) the byte order
535537
//| """
536538
//| ...
@@ -645,6 +647,7 @@ MP_PROPERTY_GETTER(rp2pio_statemachine_pending_write_obj,
645647
//| once: Optional[WriteableBuffer] = None,
646648
//| *,
647649
//| loop: Optional[WriteableBuffer] = None,
650+
//| loop2: Optional[WriteableBuffer] = None,
648651
//| swap: bool = False,
649652
//| ) -> None:
650653
//| """Read data from the RX fifo in the background, with optional looping.
@@ -653,7 +656,7 @@ MP_PROPERTY_GETTER(rp2pio_statemachine_pending_write_obj,
653656
//| This means that any ``once`` or ``loop`` buffer will be read at least once.
654657
//| Then the ``once`` and/or ``loop`` buffers are queued. and the function returns.
655658
//| The ``once`` buffer (if specified) will be read just once.
656-
//| Finally, the ``loop`` buffer (if specified) will continue being read indefinitely.
659+
//| Finally, the ``loop`` and/or ``loop2`` buffer (if specified) will continue being read indefinitely. If both ``loop`` and ``loop2`` are specified, they will alternate.
657660
//|
658661
//| Reads from the FIFO will match the input buffer's element size. For example, bytearray elements
659662
//| will perform 8 bit reads from the PIO FIFO. The RP2040's memory bus will duplicate the value into
@@ -672,6 +675,7 @@ MP_PROPERTY_GETTER(rp2pio_statemachine_pending_write_obj,
672675
//|
673676
//| :param ~Optional[circuitpython_typing.WriteableBuffer] once: Data to be read once
674677
//| :param ~Optional[circuitpython_typing.WriteableBuffer] loop: Data to be read repeatedly
678+
//| :param ~Optional[circuitpython_typing.WriteableBuffer] loop2: Data to be read repeatedly
675679
//| :param bool swap: For 2- and 4-byte elements, swap (reverse) the byte order
676680
//| """
677681
//| ...

ports/raspberrypi/common-hal/rp2pio/StateMachine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1336,7 +1336,7 @@ bool common_hal_rp2pio_statemachine_background_read(rp2pio_statemachine_obj_t *s
13361336

13371337
common_hal_mcu_disable_interrupts();
13381338
// Acknowledge any previous pending interrupt
1339-
dma_hw->ints0 |= 1u << channel_read;
1339+
dma_hw->ints1 |= 1u << channel_read;
13401340
MP_STATE_PORT(background_pio)[channel_read] = self;
13411341
dma_hw->inte1 |= 1u << channel_read;
13421342
irq_set_mask_enabled(1 << DMA_IRQ_1, true);

0 commit comments

Comments
 (0)
0