@@ -96,7 +96,7 @@ static void rp2pio_statemachine_clear_dma_write(int pio_index, int sm) {
9696 if (!dma_hw -> inte0 ) {
9797 irq_set_mask_enabled (1 << DMA_IRQ_0 , false);
9898 }
99- MP_STATE_PORT (background_pio )[channel_write ] = NULL ;
99+ MP_STATE_PORT (background_pio_write )[channel_write ] = NULL ;
100100 dma_channel_abort (channel_write );
101101 dma_channel_unclaim (channel_write );
102102 }
@@ -111,7 +111,7 @@ static void rp2pio_statemachine_clear_dma_read(int pio_index, int sm) {
111111 if (!dma_hw -> inte0 ) {
112112 irq_set_mask_enabled (1 << DMA_IRQ_0 , false);
113113 }
114- MP_STATE_PORT (background_pio )[channel_read ] = NULL ;
114+ MP_STATE_PORT (background_pio_read )[channel_read ] = NULL ;
115115 dma_channel_abort (channel_read );
116116 dma_channel_unclaim (channel_read );
117117 }
@@ -1229,7 +1229,7 @@ bool common_hal_rp2pio_statemachine_background_write(rp2pio_statemachine_obj_t *
12291229
12301230 // Acknowledge any previous pending interrupt
12311231 dma_hw -> ints0 |= 1u << channel_write ;
1232- MP_STATE_PORT (background_pio )[channel_write ] = self ;
1232+ MP_STATE_PORT (background_pio_write )[channel_write ] = self ;
12331233 dma_hw -> inte0 |= 1u << channel_write ;
12341234
12351235 irq_set_mask_enabled (1 << DMA_IRQ_0 , true);
@@ -1393,9 +1393,9 @@ bool common_hal_rp2pio_statemachine_background_read(rp2pio_statemachine_obj_t *s
13931393 common_hal_mcu_disable_interrupts ();
13941394 // Acknowledge any previous pending interrupt
13951395 dma_hw -> ints1 |= 1u << channel_read ;
1396- MP_STATE_PORT (background_pio )[channel_read ] = self ;
1396+ MP_STATE_PORT (background_pio_read )[channel_read ] = self ;
13971397 dma_hw -> inte1 |= 1u << channel_read ;
1398- irq_set_mask_enabled (1 << DMA_IRQ_1 , true);
1398+ irq_set_mask_enabled (1 << DMA_IRQ_0 , true);
13991399 dma_start_channel_mask ((1u << channel_read ));
14001400 common_hal_mcu_enable_interrupts ();
14011401
@@ -1485,4 +1485,5 @@ mp_obj_t common_hal_rp2pio_statemachine_get_last_write(rp2pio_statemachine_obj_t
14851485
14861486// Use a compile-time constant for MP_REGISTER_POINTER so the preprocessor will
14871487// not split the expansion across multiple lines.
1488- MP_REGISTER_ROOT_POINTER (mp_obj_t background_pio [enum_NUM_DMA_CHANNELS ]);
1488+ MP_REGISTER_ROOT_POINTER (mp_obj_t background_pio_read [enum_NUM_DMA_CHANNELS ]);
1489+ MP_REGISTER_ROOT_POINTER (mp_obj_t background_pio_write [enum_NUM_DMA_CHANNELS ]);
0 commit comments