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:
parent
7387f60920
commit
cfd71d9023
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user