Skip to content

Commit

Permalink
Workaround for uart makefile issues (#23192)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored Mar 2, 2024
1 parent 21276de commit 092ef66
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
5 changes: 5 additions & 0 deletions platforms/chibios/chibios_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion platforms/chibios/drivers/uart_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
11 changes: 0 additions & 11 deletions platforms/chibios/platform.mk
Original file line number Diff line number Diff line change
Expand Up @@ -329,17 +329,6 @@ ifeq ($(strip $(USE_CHIBIOS_CONTRIB)),yes)
EXTRAINCDIRS += $(PLATFORMINC_CONTRIB) $(HALINC_CONTRIB) $(CHIBIOS_CONTRIB)/os/various
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
##############################################################################
Expand Down

0 comments on commit 092ef66

Please sign in to comment.