File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -187,3 +187,12 @@ bool common_hal_busio_uart_ready_to_tx(busio_uart_obj_t *self) {
187
187
ioctl (busio_uart_dev [self -> number ].fd , TCFLSH , (long unsigned int )NULL );
188
188
return true;
189
189
}
190
+
191
+ void busio_uart_reset (void ) {
192
+ for (int i = 0 ; i < MP_ARRAY_SIZE (busio_uart_dev ); i ++ ) {
193
+ if (busio_uart_dev [i ].fd >= 0 ) {
194
+ close (busio_uart_dev [i ].fd );
195
+ busio_uart_dev [i ].fd = -1 ;
196
+ }
197
+ }
198
+ }
Original file line number Diff line number Diff line change @@ -40,4 +40,6 @@ typedef struct {
40
40
uint32_t timeout ;
41
41
} busio_uart_obj_t ;
42
42
43
+ void busio_uart_reset (void );
44
+
43
45
#endif // MICROPY_INCLUDED_CXD56_COMMON_HAL_BUSIO_UART_H
Original file line number Diff line number Diff line change 35
35
#include "common-hal/analogio/AnalogIn.h"
36
36
#include "common-hal/pulseio/PulseOut.h"
37
37
#include "common-hal/pulseio/PWMOut.h"
38
+ #include "common-hal/busio/UART.h"
38
39
39
40
safe_mode_t port_init (void ) {
40
41
boardctl (BOARDIOC_INIT , 0 );
@@ -60,6 +61,9 @@ void reset_port(void) {
60
61
pulseout_reset ();
61
62
pwmout_reset ();
62
63
#endif
64
+ #if CIRCUITPY_BUSIO
65
+ busio_uart_reset ();
66
+ #endif
63
67
64
68
reset_all_pins ();
65
69
}
You can’t perform that action at this time.
0 commit comments