de-init check

This commit is contained in:
Hierophect 2019-11-11 15:47:47 -05:00
parent e076f14ea3
commit 14b70806a5

View File

@ -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;