diff --git a/keyboards/anne_pro/chibios_stm32l151.patch b/keyboards/anne_pro/chibios_stm32l151.patch new file mode 100644 index 0000000000..76fedda343 --- /dev/null +++ b/keyboards/anne_pro/chibios_stm32l151.patch @@ -0,0 +1,15 @@ +diff --git a/os/hal/ports/STM32/STM32L1xx/platform.mk b/os/hal/ports/STM32/STM32L1xx/platform.mk +index e2c2344af..dcf6f83bc 100644 +--- a/os/hal/ports/STM32/STM32L1xx/platform.mk ++++ b/os/hal/ports/STM32/STM32L1xx/platform.mk +@@ -17,8 +17,8 @@ ifneq ($(findstring HAL_USE_ADC TRUE,$(HALCONF)),) + PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/STM32L1xx/hal_adc_lld.c + endif + else +- $(CHIBIOS)/os/hal/ports/STM32/STM32L1xx/hal_adc_lld.c +-PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/STM32L1xx/hal_ext_lld_isr.c ++PLATFORMSRC += $(CHIBIOS)/os/hal/ports/STM32/STM32L1xx/hal_adc_lld.c \ ++ $(CHIBIOS)/os/hal/ports/STM32/STM32L1xx/hal_ext_lld_isr.c + endif + + # Drivers compatible with the platform. diff --git a/keyboards/anne_pro/rules.mk b/keyboards/anne_pro/rules.mk index fda74b4518..7062263a98 100644 --- a/keyboards/anne_pro/rules.mk +++ b/keyboards/anne_pro/rules.mk @@ -2,7 +2,8 @@ # the next two should match the directories in # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) MCU_FAMILY = STM32 -MCU_SERIES = STM32L1xx +# This is a hack to automatically apply the patch to ChibiOS +MCU_SERIES = $(shell echo STM32L1xx; cd lib/chibios; git apply ../../keyboards/anne_pro/chibios_stm32l151.patch 2>/dev/null) # linker script to use # it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ # or /ld/