mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-17 18:43:50 +01:00
cpu/sam0/uart: enable peripheral clock before accessing regs
This commit is contained in:
parent
4f25c1017d
commit
cf5e207d62
@ -162,6 +162,9 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
|
||||
return UART_NODEV;
|
||||
}
|
||||
|
||||
/* enable peripheral clock */
|
||||
sercom_clk_en(dev(uart));
|
||||
|
||||
/* must disable here first to ensure idempotency */
|
||||
dev(uart)->CTRLA.reg = 0;
|
||||
|
||||
@ -173,9 +176,6 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
|
||||
/* configure pins */
|
||||
_configure_pins(uart);
|
||||
|
||||
/* enable peripheral clock */
|
||||
sercom_clk_en(dev(uart));
|
||||
|
||||
/* reset the UART device */
|
||||
_reset(dev(uart));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user