driver: uart stm32: Check irq enabled in API calls
When calling irq_rx_ready or irq_tx_ready API, return the logical AND between the irq status and the enable of that irq. Signed-off-by: Nicolas VINCENT <nicolas.vincent@vossloh.com>
This commit is contained in:
parent
4c514b39df
commit
eb534d39d2
1 changed files with 4 additions and 2 deletions
|
@ -533,7 +533,8 @@ static int uart_stm32_irq_tx_ready(const struct device *dev)
|
|||
{
|
||||
USART_TypeDef *UartInstance = UART_STRUCT(dev);
|
||||
|
||||
return LL_USART_IsActiveFlag_TXE(UartInstance);
|
||||
return LL_USART_IsActiveFlag_TXE(UartInstance) &&
|
||||
LL_USART_IsEnabledIT_TC(UartInstance);
|
||||
}
|
||||
|
||||
static int uart_stm32_irq_tx_complete(const struct device *dev)
|
||||
|
@ -561,7 +562,8 @@ static int uart_stm32_irq_rx_ready(const struct device *dev)
|
|||
{
|
||||
USART_TypeDef *UartInstance = UART_STRUCT(dev);
|
||||
|
||||
return LL_USART_IsActiveFlag_RXNE(UartInstance);
|
||||
return LL_USART_IsActiveFlag_RXNE(UartInstance) &&
|
||||
LL_USART_IsEnabledIT_RXNE(UartInstance);
|
||||
}
|
||||
|
||||
static void uart_stm32_irq_err_enable(const struct device *dev)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue