File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
ports/raspberrypi/common-hal/board Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 29
29
#include "py/runtime.h"
30
30
#include "py/mphal.h"
31
31
#include "common-hal/microcontroller/Pin.h"
32
+ #include "src/rp2_common/hardware_pio/include/hardware/pio.h"
33
+ #include "shared-module/board/__init__.h"
32
34
33
35
// Pins aren't actually defined here. They are in the board specific directory
34
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 28
28
#include "supervisor/shared/translate.h"
29
29
#include "mpconfigboard.h"
30
30
#include "py/runtime.h"
31
+ #include "shared-module/board/__init__.h"
31
32
32
33
#if CIRCUITPY_BUSIO
33
34
#include "shared-bindings/busio/I2C.h"
@@ -179,4 +180,7 @@ void reset_board_busses(void) {
179
180
#if BOARD_UART
180
181
MP_STATE_VM (shared_uart_bus ) = NULL ;
181
182
#endif
183
+ #if CIRCUITPY_RP2PIO
184
+ board_reset_pio ();
185
+ #endif
182
186
}
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 );
31
32
32
33
#endif // MICROPY_INCLUDED_SHARED_MODULE_BOARD__INIT__H
You can’t perform that action at this time.
0 commit comments