aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal')
-rw-r--r--os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c14
-rw-r--r--os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c14
2 files changed, 23 insertions, 5 deletions
diff --git a/os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c b/os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c
index 8dadd1193..4014ab5bb 100644
--- a/os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c
+++ b/os/hal/ports/STM32/LLD/USARTv2/hal_serial_lld.c
@@ -53,14 +53,18 @@
#define USART_CR1_M_1 (1 << 28)
#endif
-/* Handling the case where UART4 and UART5 are actually USARTs, this happens
- in the STM32F0xx.*/
+/* Workarounds for those devices where UARTs are USARTs.*/
#if defined(USART4)
-#define UART4 USART4
+#define UART4 USART4
#endif
-
#if defined(USART5)
-#define UART5 USART5
+#define UART5 USART5
+#endif
+#if defined(USART7)
+#define UART7 USART7
+#endif
+#if defined(USART8)
+#define UART8 USART8
#endif
/*===========================================================================*/
diff --git a/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c b/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c
index 04e25d9c1..5bf3b6089 100644
--- a/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c
+++ b/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c
@@ -30,6 +30,20 @@
/* Driver local definitions. */
/*===========================================================================*/
+/* For compatibility for those devices without LIN support in the USARTs.*/
+#if !defined(USART_ISR_LBDF)
+#define USART_ISR_LBDF 0
+#endif
+
+#if !defined(USART_CR2_LBDIE)
+#define USART_CR2_LBDIE 0
+#endif
+
+/* STM32L0xx/STM32F7xx ST headers difference.*/
+#if !defined(USART_ISR_LBDF)
+#define USART_ISR_LBDF USART_ISR_LBD
+#endif
+
/* STM32L0xx/STM32F7xx ST headers difference.*/
#if !defined(USART_ISR_LBDF)
#define USART_ISR_LBDF USART_ISR_LBD