1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #15518 from aabadie/pr/cpu/cc2538_uart_irq

cpu/cc2538: enable UART IRQ only if cb is not NULL
This commit is contained in:
benpicco 2020-11-28 18:51:27 +01:00 committed by GitHub
commit c337089de5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,15 +145,13 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
/* Configure line control for 8-bit, no parity, 1 stop bit and enable */
u->cc2538_uart_lcrh.LCRH = (WLEN_8_BITS << 5) | FEN;
/* register callbacks */
/* register callbacks and enable UART irq */
if (rx_cb) {
uart_ctx[uart].rx_cb = rx_cb;
uart_ctx[uart].arg = arg;
NVIC_EnableIRQ(UART_IRQ(uart_num));
}
/* enable UART interrupt */
NVIC_EnableIRQ(UART_IRQ(uart_num));
/* UART Enable */
u->cc2538_uart_ctl.CTLbits.UARTEN = 1;