From 14b70806a5aacd3a5346940e6a07d32464d73506 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Mon, 11 Nov 2019 15:47:47 -0500 Subject: [PATCH] de-init check --- ports/stm32f4/common-hal/busio/UART.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/stm32f4/common-hal/busio/UART.c b/ports/stm32f4/common-hal/busio/UART.c index 8e08fd3bd7..c5e2edfa34 100644 --- a/ports/stm32f4/common-hal/busio/UART.c +++ b/ports/stm32f4/common-hal/busio/UART.c @@ -312,6 +312,8 @@ bool common_hal_busio_uart_deinited(busio_uart_obj_t *self) { } void common_hal_busio_uart_deinit(busio_uart_obj_t *self) { + if(common_hal_busio_uart_deinited(self)) return; + reset_pin_number(self->tx->pin->port,self->tx->pin->number); reset_pin_number(self->rx->pin->port,self->rx->pin->number); self->tx = mp_const_none;