Skip to content
Snippets Groups Projects
Commit ef1a8c66 authored by Kaspar Schleiser's avatar Kaspar Schleiser
Browse files

cpu/sam0/periph/uart: ensure uart_init() idempotency

parent f689599f
Branches
No related tags found
No related merge requests found
......@@ -57,6 +57,9 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
return UART_NODEV;
}
/* must disable here first to ensure idempotency */
dev(uart)->CTRLA.reg &= ~(SERCOM_USART_CTRLA_ENABLE);
/* configure pins */
gpio_init(uart_config[uart].rx_pin, GPIO_IN);
gpio_init_mux(uart_config[uart].rx_pin, uart_config[uart].mux);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment