From a74927ff5bf96caf8a3b7c1cff9b416d51a873a5 Mon Sep 17 00:00:00 2001 From: crasbe Date: Sun, 30 Mar 2025 00:37:56 +0100 Subject: [PATCH] boards/nucleo64: add compile warning about LED0 when using SPI --- boards/common/nucleo64/Makefile.dep | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/boards/common/nucleo64/Makefile.dep b/boards/common/nucleo64/Makefile.dep index d9bc77f856..6a372b4aa1 100644 --- a/boards/common/nucleo64/Makefile.dep +++ b/boards/common/nucleo64/Makefile.dep @@ -1,6 +1,15 @@ +# include color echo macros +include $(RIOTMAKE)/utils/ansi.mk +include $(RIOTMAKE)/color.inc.mk + ifneq (,$(filter periph_spi,$(USEMODULE))) - # The LED pin is also used for SPI - DISABLE_MODULE += periph_init_led0 + # The LED pin is also used for SPI, disable the LED0 module (once) + ifeq (,$(filter periph_init_led0,$(DISABLE_MODULE))) + DISABLE_MODULE += periph_init_led0 + + MSG="Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts." + $(shell $(COLOR_ECHO) "$(COLOR_RED)$(MSG)$(COLOR_RESET)" 1>&2) + endif endif include $(RIOTBOARD)/common/nucleo/Makefile.dep