diff --git a/boards/nucleo-common/include/gpio_params.h b/boards/nucleo-common/include/gpio_params.h index c342ee8b22..21f538cd01 100644 --- a/boards/nucleo-common/include/gpio_params.h +++ b/boards/nucleo-common/include/gpio_params.h @@ -31,11 +31,13 @@ extern "C" { */ static const saul_gpio_params_t saul_gpio_params[] = { +#ifdef AUTO_INIT_LED0 { .name = "LED(green)", .pin = LED0_PIN, .mode = GPIO_OUT }, +#endif { .name = "Button(B1 User)", .pin = BTN_B1_PIN, diff --git a/boards/nucleo-f030/board.c b/boards/nucleo-f030/board.c index 28c6dcf2e1..da9f9b1b9e 100644 --- a/boards/nucleo-f030/board.c +++ b/boards/nucleo-f030/board.c @@ -26,9 +26,12 @@ void board_init(void) { - /* initialize the boards LED */ - gpio_init(LED0_PIN, GPIO_OUT); - /* initialize the CPU */ cpu_init(); + +#ifdef AUTO_INIT_LED0 + /* The LED pin is also used for SPI, so we enable it + only if explicitly wanted by the user */ + gpio_init(LED0_PIN, GPIO_OUT); +#endif } diff --git a/boards/nucleo-f070/board.c b/boards/nucleo-f070/board.c index 33935444a8..c127cb11be 100644 --- a/boards/nucleo-f070/board.c +++ b/boards/nucleo-f070/board.c @@ -26,9 +26,12 @@ void board_init(void) { - /* initialize the boards LED */ - gpio_init(LED0_PIN, GPIO_OUT); - /* initialize the CPU */ cpu_init(); + +#ifdef AUTO_INIT_LED0 + /* The LED pin is also used for SPI, so we enable it + only if explicitly wanted by the user */ + gpio_init(LED0_PIN, GPIO_OUT); +#endif } diff --git a/boards/nucleo-f072/board.c b/boards/nucleo-f072/board.c index 9737786a8a..7e62553e80 100644 --- a/boards/nucleo-f072/board.c +++ b/boards/nucleo-f072/board.c @@ -25,9 +25,12 @@ void board_init(void) { - /* initialize the boards LED */ - gpio_init(LED0_PIN, GPIO_OUT); - /* initialize the CPU */ cpu_init(); + +#ifdef AUTO_INIT_LED0 + /* The LED pin is also used for SPI, so we enable it + only if explicitly wanted by the user */ + gpio_init(LED0_PIN, GPIO_OUT); +#endif } diff --git a/boards/nucleo-f091/board.c b/boards/nucleo-f091/board.c index a8d59f8929..b1244ac9f3 100644 --- a/boards/nucleo-f091/board.c +++ b/boards/nucleo-f091/board.c @@ -26,6 +26,9 @@ void board_init(void) /* initialize the CPU */ cpu_init(); - /* initialize the boards LEDs */ +#ifdef AUTO_INIT_LED0 + /* The LED pin is also used for SPI, so we enable it + only if explicitly wanted by the user */ gpio_init(LED0_PIN, GPIO_OUT); +#endif } diff --git a/boards/nucleo-f103/board.c b/boards/nucleo-f103/board.c index 1e2820e373..ddbc97ef2d 100644 --- a/boards/nucleo-f103/board.c +++ b/boards/nucleo-f103/board.c @@ -26,6 +26,9 @@ void board_init(void) /* initialize the CPU */ cpu_init(); - /* initialize the boards LEDs */ +#ifdef AUTO_INIT_LED0 + /* The LED pin is also used for SPI, so we enable it + only if explicitly wanted by the user */ gpio_init(LED0_PIN, GPIO_OUT); +#endif } diff --git a/boards/nucleo-f302/board.c b/boards/nucleo-f302/board.c index d291b0e2a3..f59a752799 100755 --- a/boards/nucleo-f302/board.c +++ b/boards/nucleo-f302/board.c @@ -26,6 +26,9 @@ void board_init(void) /* initialize the CPU */ cpu_init(); - /* initialize the boards LEDs */ +#ifdef AUTO_INIT_LED0 + /* The LED pin is also used for SPI, so we enable it + only if explicitly wanted by the user */ gpio_init(LED0_PIN, GPIO_OUT); +#endif } diff --git a/boards/nucleo-f303/board.c b/boards/nucleo-f303/board.c index d291b0e2a3..f59a752799 100755 --- a/boards/nucleo-f303/board.c +++ b/boards/nucleo-f303/board.c @@ -26,6 +26,9 @@ void board_init(void) /* initialize the CPU */ cpu_init(); - /* initialize the boards LEDs */ +#ifdef AUTO_INIT_LED0 + /* The LED pin is also used for SPI, so we enable it + only if explicitly wanted by the user */ gpio_init(LED0_PIN, GPIO_OUT); +#endif } diff --git a/boards/nucleo-f334/board.c b/boards/nucleo-f334/board.c index bb320d3f9c..6c69470772 100644 --- a/boards/nucleo-f334/board.c +++ b/boards/nucleo-f334/board.c @@ -26,6 +26,9 @@ void board_init(void) /* initialize the CPU */ cpu_init(); - /* initialize the boards LEDs */ +#ifdef AUTO_INIT_LED0 + /* The LED pin is also used for SPI, so we enable it + only if explicitly wanted by the user */ gpio_init(LED0_PIN, GPIO_OUT); +#endif } diff --git a/boards/nucleo-f401/board.c b/boards/nucleo-f401/board.c index 5459df139b..2c392f81f9 100644 --- a/boards/nucleo-f401/board.c +++ b/boards/nucleo-f401/board.c @@ -26,6 +26,9 @@ void board_init(void) /* initialize the CPU */ cpu_init(); - /* initialize the boards LEDs */ +#ifdef AUTO_INIT_LED0 + /* The LED pin is also used for SPI, so we enable it + only if explicitly wanted by the user */ gpio_init(LED0_PIN, GPIO_OUT); +#endif } diff --git a/boards/nucleo-f410/board.c b/boards/nucleo-f410/board.c index 7783102489..fc48de3350 100644 --- a/boards/nucleo-f410/board.c +++ b/boards/nucleo-f410/board.c @@ -26,6 +26,9 @@ void board_init(void) /* initialize the CPU */ cpu_init(); - /* initialize the boards LEDs */ +#ifdef AUTO_INIT_LED0 + /* The LED pin is also used for SPI, so we enable it + only if explicitly wanted by the user */ gpio_init(LED0_PIN, GPIO_OUT); +#endif } diff --git a/boards/nucleo-f411/board.c b/boards/nucleo-f411/board.c index fd4f82a446..6d899e21b1 100644 --- a/boards/nucleo-f411/board.c +++ b/boards/nucleo-f411/board.c @@ -26,6 +26,9 @@ void board_init(void) /* initialize the CPU */ cpu_init(); - /* initialize the boards LEDs */ +#ifdef AUTO_INIT_LED0 + /* The LED pin is also used for SPI, so we enable it + only if explicitly wanted by the user */ gpio_init(LED0_PIN, GPIO_OUT); +#endif } diff --git a/boards/nucleo-f446/board.c b/boards/nucleo-f446/board.c index 60cb20a4ef..d43b11a2a4 100644 --- a/boards/nucleo-f446/board.c +++ b/boards/nucleo-f446/board.c @@ -26,6 +26,9 @@ void board_init(void) /* initialize the CPU */ cpu_init(); - /* initialize the boards LEDs */ +#ifdef AUTO_INIT_LED0 + /* The LED pin is also used for SPI, so we enable it + only if explicitly wanted by the user */ gpio_init(LED0_PIN, GPIO_OUT); +#endif } diff --git a/boards/nucleo-l053/board.c b/boards/nucleo-l053/board.c index 7f18a5b107..149aaf381f 100644 --- a/boards/nucleo-l053/board.c +++ b/boards/nucleo-l053/board.c @@ -26,9 +26,12 @@ void board_init(void) { - /* initialize the boards LED */ - gpio_init(LED0_PIN, GPIO_OUT); - /* initialize the CPU */ cpu_init(); + +#ifdef AUTO_INIT_LED0 + /* The LED pin is also used for SPI, so we enable it + only if explicitly wanted by the user */ + gpio_init(LED0_PIN, GPIO_OUT); +#endif } diff --git a/boards/nucleo-l073/board.c b/boards/nucleo-l073/board.c index 03eb7f4cae..55437879dd 100644 --- a/boards/nucleo-l073/board.c +++ b/boards/nucleo-l073/board.c @@ -26,9 +26,12 @@ void board_init(void) { - /* initialize the boards LED */ - gpio_init(LED0_PIN, GPIO_OUT); - /* initialize the CPU */ cpu_init(); + +#ifdef AUTO_INIT_LED0 + /* The LED pin is also used for SPI, so we enable it + only if explicitly wanted by the user */ + gpio_init(LED0_PIN, GPIO_OUT); +#endif } diff --git a/boards/nucleo-l1/board.c b/boards/nucleo-l1/board.c index a26984467b..f6c1db50e4 100644 --- a/boards/nucleo-l1/board.c +++ b/boards/nucleo-l1/board.c @@ -26,6 +26,9 @@ void board_init(void) /* initialize the CPU */ cpu_init(); - /* initialize the boards LEDs */ +#ifdef AUTO_INIT_LED0 + /* The LED pin is also used for SPI, so we enable it + only if explicitly wanted by the user */ gpio_init(LED0_PIN, GPIO_OUT); +#endif }