fix: Prevent enabling USART IRQ if not supported (#4086)

Fixes #4073
This commit is contained in:
Raphael Coeffic
2023-09-23 14:45:15 +10:00
committed by GitHub
parent 5597cf6476
commit 60ccd852e3
@@ -289,7 +289,9 @@ void stm32_usart_init(const stm32_usart_t* usart, const etx_serial_init* params)
if (params->direction & ETX_Dir_RX) {
// IRQ based RX
LL_USART_EnableIT_RXNE(usart->USARTx);
if ((int32_t)(usart->IRQn) >= 0) {
LL_USART_EnableIT_RXNE(usart->USARTx);
}
// half-duplex: start in input mode
if (usart->set_input)