Fix nRF UART reset

disable only turns off ENABLE but doesn't set the init tracking that
nrfx uses. uninit hangs if ENABLE is off and is called because it
waits forever for TX to stop.
This commit is contained in:
Scott Shawcroft 2019-12-27 20:18:07 -08:00
parent 7387f60920
commit cfd71d9023
No known key found for this signature in database
GPG Key ID: 9349BC7E64B1921E

View File

@ -124,7 +124,7 @@ static void uart_callback_irq (const nrfx_uarte_event_t * event, void * context)
void uart_reset(void) {
for (size_t i = 0 ; i < MP_ARRAY_SIZE(nrfx_uartes); i++) {
nrf_uarte_disable(nrfx_uartes[i].p_reg);
nrfx_uarte_uninit(&nrfx_uartes[i]);
}
}
@ -171,7 +171,6 @@ void common_hal_busio_uart_construct (busio_uart_obj_t *self,
}
};
nrfx_uarte_uninit(self->uarte);
_VERIFY_ERR(nrfx_uarte_init(self->uarte, &config, uart_callback_irq));
// Init buffer for rx