summaryrefslogtreecommitdiff
path: root/platforms/chibios/platform.mk
diff options
context:
space:
mode:
Diffstat (limited to 'platforms/chibios/platform.mk')
-rw-r--r--platforms/chibios/platform.mk11
1 files changed, 11 insertions, 0 deletions
diff --git a/platforms/chibios/platform.mk b/platforms/chibios/platform.mk
index f38a888012..a2178412f3 100644
--- a/platforms/chibios/platform.mk
+++ b/platforms/chibios/platform.mk
@@ -330,6 +330,17 @@ 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
##############################################################################