diff options
-rw-r--r-- | os/hal/ports/SAMA/LLD/SPIv1/driver.mk | 6 | ||||
-rw-r--r-- | os/hal/ports/SAMA/SAMA5D2x/platform.mk | 13 |
2 files changed, 18 insertions, 1 deletions
diff --git a/os/hal/ports/SAMA/LLD/SPIv1/driver.mk b/os/hal/ports/SAMA/LLD/SPIv1/driver.mk index 7a873464d..cafe59fb8 100644 --- a/os/hal/ports/SAMA/LLD/SPIv1/driver.mk +++ b/os/hal/ports/SAMA/LLD/SPIv1/driver.mk @@ -1,2 +1,8 @@ +ifeq ($(USE_SMART_BUILD),yes)
+ifneq ($(findstring HAL_USE_SPI TRUE,$(HALCONF)),)
PLATFORMSRC += $(CHIBIOS)/os/hal/ports/SAMA/LLD/SPIv1/hal_spi_lld.c
+else
+PLATFORMSRC += $(CHIBIOS)/os/hal/ports/SAMA/LLD/SPIv1/hal_spi_lld.c
+endif
+
PLATFORMINC += $(CHIBIOS)/os/hal/ports/SAMA/LLD/SPIv1
diff --git a/os/hal/ports/SAMA/SAMA5D2x/platform.mk b/os/hal/ports/SAMA/SAMA5D2x/platform.mk index 0ae77f33d..091b6f507 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/platform.mk +++ b/os/hal/ports/SAMA/SAMA5D2x/platform.mk @@ -7,7 +7,18 @@ PLATFORMSRC := $(CHIBIOS)/os/hal/ports/SAMA/SAMA5D2x/hal_lld.c \ # Required include directories.
PLATFORMINC := $(CHIBIOS)/os/hal/ports/SAMA/SAMA5D2x
-# TODO: Add smart build.
+# Optional platform files.
+ifeq ($(USE_SMART_BUILD),yes)
+
+# Configuration files directory
+ifeq ($(CONFDIR),)
+ CONFDIR = .
+endif
+
+HALCONF := $(strip $(shell cat $(CONFDIR)/halconf.h | egrep -e "\#define"))
+
+else
+endif
# Drivers compatible with the platform.
include $(CHIBIOS)/os/hal/ports/SAMA/LLD/DMAv1/driver.mk
|