Skip to content
Snippets Groups Projects
Commit 6da78131 authored by Francisco Acosta's avatar Francisco Acosta Committed by GitHub
Browse files

Merge pull request #7675 from kaspar030/fix_sam0_uart

cpu/sam0/periph/uart: ensure uart_init() idempotency
parents f13207b7 ef1a8c66
No related branches found
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