Skip to content

Commit f2e153c

Browse files
committed
STM32G4 : serial issue with LP_UART1
1 parent 9738b27 commit f2e153c

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

targets/TARGET_STM/TARGET_STM32G4/serial_device.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include "serial_api_hal.h"
1919

20-
#define UART_NUM (5)
20+
#define UART_NUM (6)
2121

2222

2323
uint32_t serial_irq_ids[UART_NUM] = {0};
@@ -158,18 +158,12 @@ void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable)
158158
if (irq == RxIrq) {
159159
__HAL_UART_DISABLE_IT(huart, UART_IT_RXNE);
160160
// Check if TxIrq is disabled too
161-
#if defined(STM32G0)
162-
#define USART_CR1_TXEIE USART_CR1_TXEIE_TXFNFIE
163-
#endif
164161
if ((huart->Instance->CR1 & USART_CR1_TXEIE) == 0) {
165162
all_disabled = 1;
166163
}
167164
} else { // TxIrq
168165
__HAL_UART_DISABLE_IT(huart, UART_IT_TXE);
169166
// Check if RxIrq is disabled too
170-
#if defined(STM32G0)
171-
#define USART_CR1_RXNEIE USART_CR1_RXNEIE_RXFNEIE
172-
#endif
173167
if ((huart->Instance->CR1 & USART_CR1_RXNEIE) == 0) {
174168
all_disabled = 1;
175169
}

0 commit comments

Comments
 (0)