From fb7d211530d842b6efdc230c8834d9d0bd6f6f67 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Mon, 28 Nov 2022 12:21:27 +0100 Subject: [PATCH] stm32/boards: Add missing LPUART macros for H7 HAL. The STM32H7xx HAL LPUART AF macros are missing the number, this HAL is the only one that's inconsistent in the way it defines LPUART AF macros, so we only need to define them for H7. --- ports/stm32/boards/stm32h7xx_hal_conf_base.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/stm32/boards/stm32h7xx_hal_conf_base.h b/ports/stm32/boards/stm32h7xx_hal_conf_base.h index 08928ed59..9c5ec8cb2 100644 --- a/ports/stm32/boards/stm32h7xx_hal_conf_base.h +++ b/ports/stm32/boards/stm32h7xx_hal_conf_base.h @@ -101,4 +101,10 @@ // HAL parameter assertions are disabled #define assert_param(expr) ((void)0) +// The STM32H7xx HAL defines LPUART1 AF macros without numbers. +#ifndef GPIO_AF3_LPUART1 +#define GPIO_AF3_LPUART1 GPIO_AF3_LPUART +#define GPIO_AF8_LPUART1 GPIO_AF8_LPUART +#endif + #endif // MICROPY_INCLUDED_STM32H7XX_HAL_CONF_BASE_H