mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
cpu/sam0_common: UART: simplify init sequence
We don't need to read-modify-write the CTRLA register to disable the UART. The entire CTRLA register is re-written just a few lines below, so we can just set it to 0 to disable the UART. There is also no need to reset the UART since we re-write all config registers in init.
This commit is contained in:
parent
28c1c502bc
commit
e1f84de6c5
@ -129,7 +129,7 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
|
||||
}
|
||||
|
||||
/* must disable here first to ensure idempotency */
|
||||
dev(uart)->CTRLA.reg &= ~(SERCOM_USART_CTRLA_ENABLE);
|
||||
dev(uart)->CTRLA.reg = 0;
|
||||
|
||||
#ifdef MODULE_PERIPH_UART_NONBLOCKING
|
||||
/* set up the TX buffer */
|
||||
|
Loading…
Reference in New Issue
Block a user