Skip to content

STM32G4 : serial issue with LP_UART1 #14581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions targets/TARGET_STM/TARGET_STM32G4/serial_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include "serial_api_hal.h"

#define UART_NUM (5)
#define UART_NUM (6)


uint32_t serial_irq_ids[UART_NUM] = {0};
Expand Down Expand Up @@ -158,18 +158,12 @@ void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable)
if (irq == RxIrq) {
__HAL_UART_DISABLE_IT(huart, UART_IT_RXNE);
// Check if TxIrq is disabled too
#if defined(STM32G0)
#define USART_CR1_TXEIE USART_CR1_TXEIE_TXFNFIE
#endif
if ((huart->Instance->CR1 & USART_CR1_TXEIE) == 0) {
all_disabled = 1;
}
} else { // TxIrq
__HAL_UART_DISABLE_IT(huart, UART_IT_TXE);
// Check if RxIrq is disabled too
#if defined(STM32G0)
#define USART_CR1_RXNEIE USART_CR1_RXNEIE_RXFNEIE
#endif
if ((huart->Instance->CR1 & USART_CR1_RXNEIE) == 0) {
all_disabled = 1;
}
Expand Down