File tree Expand file tree Collapse file tree 4 files changed +13
-12
lines changed
ports/raspberrypi/common-hal Expand file tree Collapse file tree 4 files changed +13
-12
lines changed Original file line number Diff line number Diff line change 34
34
35
35
// Pins aren't actually defined here. They are in the board specific directory
36
36
// such as boards/arduino_zero/pins.c.
37
-
38
- // routine to reset both pios
39
- void board_reset_pio () {
40
- for ( uint8_t sm = 0 ; sm < 4 ; sm ++ ) {
41
- pio_sm_init (pio0 , sm , 0 , NULL );
42
- pio_sm_init (pio1 , sm , 0 , NULL );
43
- }
44
- pio_clear_instruction_memory (pio0 );
45
- pio_clear_instruction_memory (pio1 );
46
- }
Original file line number Diff line number Diff line change 34
34
#include "src/rp2_common/hardware_dma/include/hardware/dma.h"
35
35
#include "src/rp2_common/hardware_pio/include/hardware/pio_instructions.h"
36
36
#include "src/rp2040/hardware_structs/include/hardware/structs/iobank0.h"
37
+ #include "src/rp2_common/hardware_irq/include/hardware/irq.h"
37
38
38
39
#include "lib/utils/interrupt_char.h"
39
40
#include "py/obj.h"
@@ -101,6 +102,13 @@ void reset_rp2pio_statemachine(void) {
101
102
_reset_statemachine (pio , j , false);
102
103
}
103
104
}
105
+ for (uint8_t irq = PIO0_IRQ_0 ; irq <= PIO1_IRQ_1 ; irq ++ ) {
106
+ irq_handler_t int_handler = irq_get_exclusive_handler (irq );
107
+ if (int_handler > 0 ) {
108
+ irq_set_enabled (irq , false);
109
+ irq_remove_handler (irq ,int_handler );
110
+ }
111
+ }
104
112
}
105
113
106
114
STATIC uint32_t _check_pins_free (const mcu_pin_obj_t * first_pin , uint8_t pin_count , bool exclusive_pin_use ) {
Original file line number Diff line number Diff line change 45
45
#include "shared-module/sharpdisplay/SharpMemoryFramebuffer.h"
46
46
#endif
47
47
48
+ #if CIRCUITPY_RP2PIO
49
+ #include "bindings/rp2pio/StateMachine.h"
50
+ #endif
51
+
48
52
#if BOARD_I2C
49
53
// Statically allocate the I2C object so it can live past the end of the heap and into the next VM.
50
54
// That way it can be used by built-in I2CDisplay displays and be accessible through board.I2C().
@@ -181,6 +185,6 @@ void reset_board_busses(void) {
181
185
MP_STATE_VM (shared_uart_bus ) = NULL ;
182
186
#endif
183
187
#if CIRCUITPY_RP2PIO
184
- board_reset_pio ();
188
+ reset_rp2pio_statemachine ();
185
189
#endif
186
190
}
Original file line number Diff line number Diff line change 28
28
#define MICROPY_INCLUDED_SHARED_MODULE_BOARD__INIT__H
29
29
30
30
void reset_board_busses (void );
31
- void board_reset_pio (void );
32
31
33
32
#endif // MICROPY_INCLUDED_SHARED_MODULE_BOARD__INIT__H
You can’t perform that action at this time.
0 commit comments