Skip to content

Commit cfd71d9

Browse files
committed
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.
1 parent 7387f60 commit cfd71d9

File tree

1 file changed

+1
-2
lines changed
  • ports/nrf/common-hal/busio

1 file changed

+1
-2
lines changed

ports/nrf/common-hal/busio/UART.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static void uart_callback_irq (const nrfx_uarte_event_t * event, void * context)
124124

125125
void uart_reset(void) {
126126
for (size_t i = 0 ; i < MP_ARRAY_SIZE(nrfx_uartes); i++) {
127-
nrf_uarte_disable(nrfx_uartes[i].p_reg);
127+
nrfx_uarte_uninit(&nrfx_uartes[i]);
128128
}
129129
}
130130

@@ -171,7 +171,6 @@ void common_hal_busio_uart_construct (busio_uart_obj_t *self,
171171
}
172172
};
173173

174-
nrfx_uarte_uninit(self->uarte);
175174
_VERIFY_ERR(nrfx_uarte_init(self->uarte, &config, uart_callback_irq));
176175

177176
// Init buffer for rx

0 commit comments

Comments
 (0)