summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platforms/chibios/chibios_config.h5
-rw-r--r--platforms/chibios/drivers/uart_sio.c2
-rw-r--r--platforms/chibios/platform.mk11
3 files changed, 6 insertions, 12 deletions
diff --git a/platforms/chibios/chibios_config.h b/platforms/chibios/chibios_config.h
index 759ac6943b..8f46fe0736 100644
--- a/platforms/chibios/chibios_config.h
+++ b/platforms/chibios/chibios_config.h
@@ -108,6 +108,11 @@
# if defined(STM32F1XX) || defined(STM32F2XX) || defined(STM32F4XX) || defined(STM32L1XX)
# define USE_I2CV1
# endif
+
+# if defined(STM32G0XX) || defined(STM32G4XX) || defined(STM32L5XX) || defined(STM32H7XX)
+# define USE_USARTV3
+# endif
+
#endif
// GD32 compatibility
diff --git a/platforms/chibios/drivers/uart_sio.c b/platforms/chibios/drivers/uart_sio.c
index ebf51ae5a8..442df1c54d 100644
--- a/platforms/chibios/drivers/uart_sio.c
+++ b/platforms/chibios/drivers/uart_sio.c
@@ -16,7 +16,7 @@ static SIOConfig sioConfig = {
#else
static SIOConfig sioConfig = {
.baud = SIO_DEFAULT_BITRATE,
-# if defined(MCU_STM32) && defined(CHIBIOS_HAL_USARTv3)
+# if defined(MCU_STM32) && defined(USE_USARTV3)
.presc = USART_PRESC1,
# endif
.cr1 = UART_CR1,
diff --git a/platforms/chibios/platform.mk b/platforms/chibios/platform.mk
index a2178412f3..f38a888012 100644
--- a/platforms/chibios/platform.mk
+++ b/platforms/chibios/platform.mk
@@ -330,17 +330,6 @@ ifeq ($(strip $(USE_CHIBIOS_CONTRIB)),yes)
endif
#
-# Extract supported HAL drivers
-##############################################################################
-
-define add_lld_driver_define
- $(eval driver := $(word 2,$(subst /LLD/, ,$(1))))
- $(eval OPT_DEFS += -DCHIBIOS_HAL_$(driver))
-endef
-
-$(foreach dir,$(EXTRAINCDIRS),$(if $(findstring /LLD/,$(dir)),$(call add_lld_driver_define,$(dir))))
-
-#
# Project, sources and paths
##############################################################################