From 468ea89953a29cb229937ff4eb60c0b33c4dbeae Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Fri, 28 Jan 2022 13:28:20 +0100 Subject: [PATCH] boards: drop LED init This is handled by periph_init_leds now --- boards/6lowpan-clicker/clicker.c | 6 -- boards/Kconfig | 63 +++++++++++++++++++ boards/acd52832/board.c | 3 - boards/adafruit-clue/board.c | 3 - boards/adafruit-itsybitsy-m4/board.c | 3 - boards/adafruit-itsybitsy-nrf52/board.c | 3 - boards/alientek-pandora/board.c | 4 -- boards/arduino-leonardo/board.c | 4 -- boards/arduino-leonardo/led_init.c | 34 ---------- boards/arduino-nano-33-ble/board.c | 10 --- boards/arduino-nano-33-iot/board.c | 2 - boards/atmega256rfr2-xpro/led_init.c | 27 -------- boards/avr-rss2/led_init.c | 29 --------- boards/b-l072z-lrwan1/Kconfig | 3 + boards/b-l072z-lrwan1/Makefile.dep | 5 ++ boards/b-l072z-lrwan1/board.c | 10 --- boards/b-l072z-lrwan1/include/gpio_params.h | 2 +- boards/b-l475e-iot01a/Kconfig | 3 + boards/b-l475e-iot01a/Makefile.dep | 5 ++ boards/b-l475e-iot01a/board.c | 5 -- boards/b-l475e-iot01a/include/gpio_params.h | 2 +- boards/b-u585i-iot02a/Kconfig | 3 + boards/b-u585i-iot02a/Makefile.dep | 5 ++ boards/b-u585i-iot02a/board.c | 7 --- boards/b-u585i-iot02a/include/gpio_params.h | 2 +- boards/bastwan/board.c | 2 - boards/bluepill-stm32f030c8/board.c | 2 - boards/cc1312-launchpad/board.c | 2 - boards/cc1350-launchpad/board.c | 2 - boards/cc1352-launchpad/board.c | 2 - boards/cc1352p-launchpad/board.c | 2 - boards/cc2538dk/board.c | 5 -- boards/cc2650-launchpad/board.c | 2 - boards/cc2650stk/board.c | 2 - boards/common/arduino-atmega/led_init.c | 34 ---------- boards/common/arduino-due/board.c | 2 - boards/common/arduino-mkr/board.c | 2 - boards/common/arduino-zero/board.c | 2 - boards/common/atmega/board.c | 7 --- boards/common/atxmega/board.c | 11 ---- boards/common/blxxxpill/board.c | 1 - boards/common/e104-bt50xxa-tb/board.c | 4 -- boards/common/esp32/board_common.c | 12 ---- boards/common/esp8266/board_common.c | 12 ---- boards/common/iotlab/board_init.c | 7 --- boards/common/kw41z/board.c | 25 -------- boards/common/nrf52xxxdk/board.c | 4 -- .../common/nucleo/board_common_nucleo_init.c | 20 ------ boards/common/nucleo/include/board_nucleo.h | 5 -- boards/common/nucleo144/include/board.h | 5 -- boards/common/nucleo32/Kconfig | 3 + boards/common/nucleo32/Makefile.dep | 6 ++ boards/common/nucleo32/include/gpio_params.h | 4 +- boards/common/nucleo64/Kconfig | 3 + boards/common/nucleo64/Makefile.dep | 6 ++ boards/common/nucleo64/include/gpio_params.h | 2 +- boards/common/particle-mesh/board.c | 9 --- boards/common/saml1x/board.c | 16 ----- boards/common/silabs/board_common.c | 4 -- boards/common/sodaq/board.c | 3 - boards/common/weact-f4x1cx/board.c | 2 - boards/dwm1001/board.c | 9 --- boards/e180-zg120b-tb/board.c | 4 -- boards/ek-lm4f120xl/board.c | 16 ----- boards/f4vi1/board.c | 4 -- boards/feather-m0/board.c | 2 - boards/feather-nrf52840/board.c | 6 -- boards/firefly/board.c | 5 -- boards/frdm-k22f/board.c | 7 --- boards/frdm-k64f/board.c | 9 --- boards/frdm-kl43z/board.c | 5 -- boards/hamilton/board.c | 3 - boards/hifive1/board.c | 9 --- boards/hifive1b/board.c | 9 --- boards/ikea-tradfri/board.c | 6 -- boards/limifrog-v1/board.c | 2 - boards/lobaro-lorabox/board.c | 1 - boards/lora-e5-dev/board.c | 6 -- boards/lora-e5-dev/include/board.h | 9 --- boards/lora-e5-dev/include/gpio_params.h | 2 - boards/maple-mini/board.c | 2 - boards/mbed_lpc1768/board.c | 18 ------ boards/mcb2388/board_init.c | 4 -- boards/mega-xplained/led_init.c | 38 ----------- boards/msba2/board_init.c | 6 -- boards/msbiot/board.c | 4 -- boards/mulle/board.c | 4 -- boards/native/board_init.c | 3 - boards/nrf51dk/board.c | 11 ---- boards/nrf51dongle/board.c | 4 -- boards/nrf52832-mdk/board.c | 7 --- boards/nrf52840-mdk-dongle/board.c | 7 --- boards/nrf52840-mdk/board.c | 7 --- boards/nrf52840dongle/board.c | 10 --- boards/nrf6310/board.c | 1 - boards/nrf9160dk/board.c | 8 --- boards/nucleo-f030r8/Makefile.dep | 2 +- boards/nucleo-f031k6/Makefile.dep | 2 +- boards/nucleo-f042k6/Makefile.dep | 2 +- boards/nucleo-f070rb/Makefile.dep | 2 +- boards/nucleo-f072rb/Makefile.dep | 2 +- boards/nucleo-f091rc/Makefile.dep | 2 +- boards/nucleo-f103rb/Makefile.dep | 2 +- boards/nucleo-f302r8/Makefile.dep | 2 +- boards/nucleo-f303k8/Makefile.dep | 2 +- boards/nucleo-f303re/Makefile.dep | 2 +- boards/nucleo-f334r8/Makefile.dep | 2 +- boards/nucleo-f401re/Makefile.dep | 2 +- boards/nucleo-f410rb/Makefile.dep | 2 +- boards/nucleo-f411re/Makefile.dep | 2 +- boards/nucleo-f446re/Makefile.dep | 2 +- boards/nucleo-g070rb/Makefile.dep | 2 +- boards/nucleo-g071rb/Makefile.dep | 2 +- boards/nucleo-g431rb/Makefile.dep | 3 +- boards/nucleo-g474re/Makefile.dep | 3 +- boards/nucleo-l011k4/Makefile.dep | 2 +- boards/nucleo-l031k6/Makefile.dep | 2 +- boards/nucleo-l053r8/Makefile.dep | 2 +- boards/nucleo-l073rz/Makefile.dep | 2 +- boards/nucleo-l152re/Makefile.dep | 2 +- boards/nucleo-l412kb/Makefile.dep | 2 +- boards/nucleo-l432kc/Makefile.dep | 2 +- boards/nucleo-l433rc/Makefile.dep | 3 +- boards/nucleo-l452re/Makefile.dep | 2 +- boards/nucleo-l476rg/Makefile.dep | 2 +- boards/nucleo-wl55jc/Makefile.dep | 3 +- boards/nucleo-wl55jc/board.c | 3 - boards/nucleo-wl55jc/include/board.h | 9 --- boards/nucleo-wl55jc/include/gpio_params.h | 2 - boards/nz32-sc151/board.c | 2 - boards/olimexino-stm32/board.c | 3 - boards/omote/board.c | 16 ----- boards/opencm904/board.c | 3 - boards/openlabs-kw41z-mini/board.c | 3 - boards/openmote-b/board.c | 5 -- boards/openmote-cc2538/board.c | 5 -- boards/p-l496g-cell02/board.c | 3 - boards/p-nucleo-wb55/include/board.h | 6 -- boards/p-nucleo-wb55/include/gpio_params.h | 2 - boards/pba-d-01-kw2x/board.c | 9 --- boards/phynode-kw41z/board.c | 17 ----- boards/pic32-wifire/wifire.c | 8 --- boards/pyboard/board.c | 2 - boards/qn9080dk/board.c | 3 - boards/remote-pa/board.c | 4 -- boards/remote-reva/board.c | 5 -- boards/remote-revb/board.c | 4 -- boards/rpi-pico/board.c | 1 - boards/samd10-xmini/board.c | 2 - boards/samd20-xpro/board.c | 3 - boards/samd21-xpro/board.c | 3 - boards/same54-xpro/board.c | 5 -- boards/saml21-xpro/board.c | 17 ----- boards/samr21-xpro/board.c | 3 - boards/samr30-xpro/board.c | 16 ----- boards/samr34-xpro/board.c | 16 ----- boards/seeeduino_arch-pro/board.c | 18 ------ boards/seeeduino_xiao/board.c | 7 --- boards/sensebox_samd21/board.c | 4 -- boards/serpente/board.c | 7 --- boards/sodaq-one/board.c | 7 --- boards/sodaq-sara-aff/Kconfig | 3 + boards/sodaq-sara-aff/Makefile.dep | 5 ++ boards/sodaq-sara-aff/board.c | 15 ----- boards/sodaq-sara-sff/board.c | 3 - boards/spark-core/board.c | 9 --- boards/stm32f030f4-demo/board.c | 2 - boards/stm32f0discovery/board.c | 3 - boards/stm32f3discovery/board.c | 9 --- boards/stm32f429i-disc1/board.c | 3 - boards/stm32f469i-disco/board.c | 4 -- boards/stm32f4discovery/board.c | 5 -- boards/stm32f723e-disco/Kconfig | 3 + boards/stm32f723e-disco/Makefile.dep | 5 ++ boards/stm32f723e-disco/board.c | 7 --- boards/stm32f723e-disco/include/gpio_params.h | 2 +- boards/stm32f769i-disco/board.c | 5 -- boards/stm32g0316-disco/board.c | 2 - boards/stm32l0538-disco/board.c | 3 - boards/stm32l476g-disco/board.c | 3 - boards/teensy31/board.c | 3 - boards/ublox-c030-u201/board.c | 3 - boards/waspmote-pro/board.c | 20 ------ tests/leds/Makefile | 2 +- 184 files changed, 163 insertions(+), 966 deletions(-) delete mode 100644 boards/arduino-leonardo/led_init.c delete mode 100644 boards/atmega256rfr2-xpro/led_init.c delete mode 100644 boards/avr-rss2/led_init.c delete mode 100644 boards/common/arduino-atmega/led_init.c create mode 100644 boards/common/nucleo32/Makefile.dep create mode 100644 boards/common/nucleo64/Makefile.dep delete mode 100644 boards/mega-xplained/led_init.c diff --git a/boards/6lowpan-clicker/clicker.c b/boards/6lowpan-clicker/clicker.c index c2840436f7..d755360f8b 100644 --- a/boards/6lowpan-clicker/clicker.c +++ b/boards/6lowpan-clicker/clicker.c @@ -15,12 +15,6 @@ extern void dummy(void); void board_init(void) { - /* Turn off all LED's */ - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - LED1_OFF; - LED2_OFF; - /* Stop the linker from throwing away the PIC32 config register settings */ dummy(); } diff --git a/boards/Kconfig b/boards/Kconfig index 14933a9d99..3e178bd50b 100644 --- a/boards/Kconfig +++ b/boards/Kconfig @@ -15,3 +15,66 @@ config MODULE_BOARD depends on TEST_KCONFIG help Module which holds all board-specific files. + +config MODULE_AUTO_INIT_LEDS + bool + default y + depends on TEST_KCONFIG + help + Enable auto initalization of board leds + +config MODULE_AUTO_INIT_LED0 + bool + default y + depends on TEST_KCONFIG + help + Enable auto initalization of LED0 if present + +config MODULE_AUTO_INIT_LED1 + bool + default y + depends on TEST_KCONFIG + help + Enable auto initalization of LED1 if present + +config MODULE_AUTO_INIT_LED2 + bool + default y + depends on TEST_KCONFIG + help + Enable auto initalization of LED2 if present + +config MODULE_AUTO_INIT_LED3 + bool + default y + depends on TEST_KCONFIG + help + Enable auto initalization of LED3 if present + +config MODULE_AUTO_INIT_LED4 + bool + default y + depends on TEST_KCONFIG + help + Enable auto initalization of LED4 if present + +config MODULE_AUTO_INIT_LED5 + bool + default y + depends on TEST_KCONFIG + help + Enable auto initalization of LED5 if present + +config MODULE_AUTO_INIT_LED6 + bool + default y + depends on TEST_KCONFIG + help + Enable auto initalization of LED6 if present + +config MODULE_AUTO_INIT_LED7 + bool + default y + depends on TEST_KCONFIG + help + Enable auto initalization of LED7 if present diff --git a/boards/acd52832/board.c b/boards/acd52832/board.c index fc2fa52923..0f720c68e4 100644 --- a/boards/acd52832/board.c +++ b/boards/acd52832/board.c @@ -23,7 +23,4 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_set(LED0_PIN); } diff --git a/boards/adafruit-clue/board.c b/boards/adafruit-clue/board.c index 5aee857609..f1f46993ba 100644 --- a/boards/adafruit-clue/board.c +++ b/boards/adafruit-clue/board.c @@ -25,9 +25,6 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); /* Red LED */ - /* initialize the screen backlight, turn it off by default */ gpio_init(BACKLIGHT_PIN, GPIO_OUT); gpio_clear(BACKLIGHT_PIN); diff --git a/boards/adafruit-itsybitsy-m4/board.c b/boards/adafruit-itsybitsy-m4/board.c index c163ed97cb..e135d12b64 100644 --- a/boards/adafruit-itsybitsy-m4/board.c +++ b/boards/adafruit-itsybitsy-m4/board.c @@ -56,7 +56,4 @@ mtd_dev_t *mtd0 = (mtd_dev_t *)&samd51_nor_dev; void board_init(void) { - /* initialize the on-board LED */ - gpio_init(LED0_PIN, GPIO_OUT); - LED0_OFF; } diff --git a/boards/adafruit-itsybitsy-nrf52/board.c b/boards/adafruit-itsybitsy-nrf52/board.c index 8820ac4a4c..eb55cf822d 100644 --- a/boards/adafruit-itsybitsy-nrf52/board.c +++ b/boards/adafruit-itsybitsy-nrf52/board.c @@ -24,7 +24,4 @@ void board_init(void) { - /* initialize the board's single LED */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_set(LED0_PIN); } diff --git a/boards/alientek-pandora/board.c b/boards/alientek-pandora/board.c index c727475297..a71107ac7e 100644 --- a/boards/alientek-pandora/board.c +++ b/boards/alientek-pandora/board.c @@ -23,8 +23,4 @@ void board_init(void) { - /* initialize LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); } diff --git a/boards/arduino-leonardo/board.c b/boards/arduino-leonardo/board.c index 6310110e97..9d54cc4864 100644 --- a/boards/arduino-leonardo/board.c +++ b/boards/arduino-leonardo/board.c @@ -19,11 +19,7 @@ */ #include "board.h" -#include "cpu.h" - -void led_init(void); void board_init(void) { - led_init(); } diff --git a/boards/arduino-leonardo/led_init.c b/boards/arduino-leonardo/led_init.c deleted file mode 100644 index 07c764b4d6..0000000000 --- a/boards/arduino-leonardo/led_init.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2017 Thomas Perrot - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup boards_arduino-leonardo - * @{ - * - * @file - * @brief Board specific led initialization for Arduino Leonardo - * - * @author Thomas Perrot - * - * @} - */ - -#include "board.h" -#include "cpu.h" -#include "periph/gpio.h" - -void led_init(void) -{ - /* initialize the on-board LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - LED0_OFF; - gpio_init(LED1_PIN, GPIO_OUT); - LED2_OFF; - gpio_init(LED2_PIN, GPIO_OUT); - LED2_OFF; -} diff --git a/boards/arduino-nano-33-ble/board.c b/boards/arduino-nano-33-ble/board.c index 3a1c3f218c..867a1f27b7 100644 --- a/boards/arduino-nano-33-ble/board.c +++ b/boards/arduino-nano-33-ble/board.c @@ -25,14 +25,4 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); /* Orange LED */ - gpio_init(LED1_PIN, GPIO_OUT); /* Red LED */ - gpio_set(LED1_PIN); - gpio_init(LED2_PIN, GPIO_OUT); /* Green LED */ - gpio_set(LED2_PIN); - gpio_init(LED3_PIN, GPIO_OUT); /* Blue LED */ - gpio_set(LED3_PIN); - gpio_init(LED4_PIN, GPIO_OUT); /* PWR LED */ - gpio_clear(LED4_PIN); } diff --git a/boards/arduino-nano-33-iot/board.c b/boards/arduino-nano-33-iot/board.c index f9766e9e97..6c24a6edd7 100644 --- a/boards/arduino-nano-33-iot/board.c +++ b/boards/arduino-nano-33-iot/board.c @@ -23,6 +23,4 @@ void board_init(void) { - /* initialize the on-board "Yellow" LED */ - gpio_init(LED0_PIN, GPIO_OUT); } diff --git a/boards/atmega256rfr2-xpro/led_init.c b/boards/atmega256rfr2-xpro/led_init.c deleted file mode 100644 index f68937e951..0000000000 --- a/boards/atmega256rfr2-xpro/led_init.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2019 Inria - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup boards_atmega256rfr2-xpro - * @{ - * - * @file - * @brief Board specific implementation for the Atmega256RFR2 Xplained Pro - * - * @author Alexandre Abadie - * - * @} - */ - -#include "board.h" - -void led_init(void) -{ - LED0_ENABLE_PORT; - LED0_OFF; -} diff --git a/boards/avr-rss2/led_init.c b/boards/avr-rss2/led_init.c deleted file mode 100644 index 2ba580a375..0000000000 --- a/boards/avr-rss2/led_init.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2019 Robert Olsson - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup boards_avr-rss2 - * @{ - * - * @file - * @brief Board specific LED initialization - * @author Robert Olsson - * - * - * @} - */ - -#include "board.h" - -void led_init(void) -{ - /* Ports Pins as Output */ - LED_PORT_DDR |= LED1_MASK | LED0_MASK; - /* All LEDs OFF */ - LED_PORT |= (LED1_MASK | LED0_MASK); -} diff --git a/boards/b-l072z-lrwan1/Kconfig b/boards/b-l072z-lrwan1/Kconfig index bfd681f741..6b64eec23a 100644 --- a/boards/b-l072z-lrwan1/Kconfig +++ b/boards/b-l072z-lrwan1/Kconfig @@ -34,4 +34,7 @@ config BOARD_B_L072Z_LRWAN1 select HAVE_SAUL_GPIO +config MODULE_PERIPH_INIT_LED0 + default n if MODULE_PERIPH_SPI + source "$(RIOTBOARD)/common/stm32/Kconfig" diff --git a/boards/b-l072z-lrwan1/Makefile.dep b/boards/b-l072z-lrwan1/Makefile.dep index 52861764e8..6ed0cbb1b7 100644 --- a/boards/b-l072z-lrwan1/Makefile.dep +++ b/boards/b-l072z-lrwan1/Makefile.dep @@ -5,3 +5,8 @@ endif ifneq (,$(filter saul_default,$(USEMODULE))) USEMODULE += saul_gpio endif + +ifneq (,$(filter periph_spi,$(USEMODULE))) + # The LED pin is also used for SPI + DISABLE_MODULE += periph_init_led0 +endif diff --git a/boards/b-l072z-lrwan1/board.c b/boards/b-l072z-lrwan1/board.c index d2b663448f..277398545f 100644 --- a/boards/b-l072z-lrwan1/board.c +++ b/boards/b-l072z-lrwan1/board.c @@ -28,14 +28,4 @@ void board_init(void) gpio_init(RADIO_TCXO_VCC_PIN, GPIO_OUT); gpio_set(RADIO_TCXO_VCC_PIN); #endif - -#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 - - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_init(LED3_PIN, GPIO_OUT); } diff --git a/boards/b-l072z-lrwan1/include/gpio_params.h b/boards/b-l072z-lrwan1/include/gpio_params.h index b9439313a7..9b9a5d0fc2 100644 --- a/boards/b-l072z-lrwan1/include/gpio_params.h +++ b/boards/b-l072z-lrwan1/include/gpio_params.h @@ -31,7 +31,7 @@ extern "C" { */ static const saul_gpio_params_t saul_gpio_params[] = { -#ifdef AUTO_INIT_LED0 +#ifdef MODULE_PERIPH_INIT_LED0 { .name = "LD2(red)", .pin = LED0_PIN, diff --git a/boards/b-l475e-iot01a/Kconfig b/boards/b-l475e-iot01a/Kconfig index 33bea1a02d..83b1d863d7 100644 --- a/boards/b-l475e-iot01a/Kconfig +++ b/boards/b-l475e-iot01a/Kconfig @@ -36,4 +36,7 @@ config BOARD_B_L475E_IOT01A select HAVE_LPS22HB select HAVE_LSM6DSL +config MODULE_PERIPH_INIT_LED0 + default n if MODULE_PERIPH_SPI + source "$(RIOTBOARD)/common/stm32/Kconfig" diff --git a/boards/b-l475e-iot01a/Makefile.dep b/boards/b-l475e-iot01a/Makefile.dep index 3598bb0d61..0d7a0458d0 100644 --- a/boards/b-l475e-iot01a/Makefile.dep +++ b/boards/b-l475e-iot01a/Makefile.dep @@ -5,3 +5,8 @@ ifneq (,$(filter saul_default,$(USEMODULE))) USEMODULE += lps22hb USEMODULE += lsm6dsl endif + +ifneq (,$(filter periph_spi,$(USEMODULE))) + # The LED pin is also used for SPI + DISABLE_MODULE += periph_init_led0 +endif diff --git a/boards/b-l475e-iot01a/board.c b/boards/b-l475e-iot01a/board.c index e1d8cbd4c7..ccf524a335 100644 --- a/boards/b-l475e-iot01a/board.c +++ b/boards/b-l475e-iot01a/board.c @@ -23,9 +23,4 @@ void board_init(void) { -#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/b-l475e-iot01a/include/gpio_params.h b/boards/b-l475e-iot01a/include/gpio_params.h index 0bb84e0dae..c8e17a692f 100644 --- a/boards/b-l475e-iot01a/include/gpio_params.h +++ b/boards/b-l475e-iot01a/include/gpio_params.h @@ -31,7 +31,7 @@ extern "C" { */ static const saul_gpio_params_t saul_gpio_params[] = { -#ifdef AUTO_INIT_LED0 +#ifdef MODULE_PERIPH_INIT_LED0 /* The LED pin is also used for SPI, so we enable it only if explicitly wanted by the user */ { diff --git a/boards/b-u585i-iot02a/Kconfig b/boards/b-u585i-iot02a/Kconfig index a270a59717..96acff4eb3 100644 --- a/boards/b-u585i-iot02a/Kconfig +++ b/boards/b-u585i-iot02a/Kconfig @@ -25,4 +25,7 @@ config BOARD_B_U585I_IOT02A select HAVE_HTS221 select HAVE_LPS22HH +config MODULE_PERIPH_INIT_LED0 + default n if MODULE_PERIPH_SPI + source "$(RIOTBOARD)/common/stm32/Kconfig" diff --git a/boards/b-u585i-iot02a/Makefile.dep b/boards/b-u585i-iot02a/Makefile.dep index c33cb91bbf..94ae6570c5 100644 --- a/boards/b-u585i-iot02a/Makefile.dep +++ b/boards/b-u585i-iot02a/Makefile.dep @@ -3,3 +3,8 @@ ifneq (,$(filter saul_default,$(USEMODULE))) USEMODULE += hts221 USEMODULE += lps22hh endif + +ifneq (,$(filter periph_spi,$(USEMODULE))) + # The LED pin is also used for SPI + DISABLE_MODULE += periph_init_led0 +endif diff --git a/boards/b-u585i-iot02a/board.c b/boards/b-u585i-iot02a/board.c index 5c1a9cccff..a1c749a9a4 100644 --- a/boards/b-u585i-iot02a/board.c +++ b/boards/b-u585i-iot02a/board.c @@ -23,11 +23,4 @@ void board_init(void) { -#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 - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); } diff --git a/boards/b-u585i-iot02a/include/gpio_params.h b/boards/b-u585i-iot02a/include/gpio_params.h index d735db9572..e68a927c8c 100644 --- a/boards/b-u585i-iot02a/include/gpio_params.h +++ b/boards/b-u585i-iot02a/include/gpio_params.h @@ -31,7 +31,7 @@ extern "C" { */ static const saul_gpio_params_t saul_gpio_params[] = { -#ifdef AUTO_INIT_LED0 +#ifdef MODULE_PERIPH_INIT_LED0 /* The LED pin is also used for SPI, so we enable it only if explicitly wanted by the user */ { diff --git a/boards/bastwan/board.c b/boards/bastwan/board.c index 4d9612a259..d78ddc6216 100644 --- a/boards/bastwan/board.c +++ b/boards/bastwan/board.c @@ -31,8 +31,6 @@ void board_init(void) { - /* initialize the boards LED */ - gpio_init(LED0_PIN, GPIO_OUT); #ifdef TX_SWITCH_PWR_PIN /* Enables pwr to the Antenna switch circuit */ diff --git a/boards/bluepill-stm32f030c8/board.c b/boards/bluepill-stm32f030c8/board.c index 7577d83776..719d7c6a82 100644 --- a/boards/bluepill-stm32f030c8/board.c +++ b/boards/bluepill-stm32f030c8/board.c @@ -24,6 +24,4 @@ void board_init(void) { - gpio_init(LED0_PIN, GPIO_OUT); - LED0_OFF; } diff --git a/boards/cc1312-launchpad/board.c b/boards/cc1312-launchpad/board.c index bccf57fdf4..e6d598a1b4 100644 --- a/boards/cc1312-launchpad/board.c +++ b/boards/cc1312-launchpad/board.c @@ -27,6 +27,4 @@ void board_init(void) { - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); } diff --git a/boards/cc1350-launchpad/board.c b/boards/cc1350-launchpad/board.c index ee92ee62fc..87a0f77cef 100644 --- a/boards/cc1350-launchpad/board.c +++ b/boards/cc1350-launchpad/board.c @@ -25,6 +25,4 @@ void board_init(void) { - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); } diff --git a/boards/cc1352-launchpad/board.c b/boards/cc1352-launchpad/board.c index 4b5d26d971..33ca6b4a8a 100644 --- a/boards/cc1352-launchpad/board.c +++ b/boards/cc1352-launchpad/board.c @@ -27,6 +27,4 @@ void board_init(void) { - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); } diff --git a/boards/cc1352p-launchpad/board.c b/boards/cc1352p-launchpad/board.c index 834c091cf0..dd736c426f 100644 --- a/boards/cc1352p-launchpad/board.c +++ b/boards/cc1352p-launchpad/board.c @@ -25,6 +25,4 @@ void board_init(void) { - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); } diff --git a/boards/cc2538dk/board.c b/boards/cc2538dk/board.c index 48197f35f6..aa7da4e768 100644 --- a/boards/cc2538dk/board.c +++ b/boards/cc2538dk/board.c @@ -30,9 +30,4 @@ */ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_init(LED3_PIN, GPIO_OUT); } diff --git a/boards/cc2650-launchpad/board.c b/boards/cc2650-launchpad/board.c index 2780df16f4..13190c2f36 100644 --- a/boards/cc2650-launchpad/board.c +++ b/boards/cc2650-launchpad/board.c @@ -27,6 +27,4 @@ void board_init(void) { - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); } diff --git a/boards/cc2650stk/board.c b/boards/cc2650stk/board.c index 93a3be98f2..c62255be08 100644 --- a/boards/cc2650stk/board.c +++ b/boards/cc2650stk/board.c @@ -25,6 +25,4 @@ */ void board_init(void) { - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); } diff --git a/boards/common/arduino-atmega/led_init.c b/boards/common/arduino-atmega/led_init.c deleted file mode 100644 index c3a7d4a12c..0000000000 --- a/boards/common/arduino-atmega/led_init.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin, Hinnerk van Bruinehsen - * 2015-18 Kaspar Schleiser - * 2016 Laurent Navet - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup boards_common_arduino-atmega - * @{ - * - * @file - * @brief Common led initialization for Arduino Atmega boards - * - * @author Hinnerk van Bruinehsen - * @author Kaspar Schleiser - * @author Laurent Navet - * - * @} - */ - -#include "board.h" -#include "cpu.h" -#include "periph/gpio.h" - -void __attribute__((weak)) led_init(void) -{ - /* initialize the on-board LED */ - gpio_init(LED0_PIN, GPIO_OUT); - LED0_OFF; -} diff --git a/boards/common/arduino-due/board.c b/boards/common/arduino-due/board.c index 703375165c..a4127bec7f 100644 --- a/boards/common/arduino-due/board.c +++ b/boards/common/arduino-due/board.c @@ -24,6 +24,4 @@ void board_init(void) { - /* initialize the on-board Amber "L" LED @ pin PB27 */ - gpio_init(LED0_PIN, GPIO_OUT); } diff --git a/boards/common/arduino-mkr/board.c b/boards/common/arduino-mkr/board.c index 95e4db5d15..8771cba735 100644 --- a/boards/common/arduino-mkr/board.c +++ b/boards/common/arduino-mkr/board.c @@ -25,6 +25,4 @@ void board_init(void) { - /* initialize the on-board Amber "L" LED */ - gpio_init(LED0_PIN, GPIO_OUT); } diff --git a/boards/common/arduino-zero/board.c b/boards/common/arduino-zero/board.c index aa8375c120..f404a0f56e 100644 --- a/boards/common/arduino-zero/board.c +++ b/boards/common/arduino-zero/board.c @@ -27,6 +27,4 @@ void board_init(void) { - /* initialize the on-board Amber "L" LED on pin PA17 */ - gpio_init(LED0_PIN, GPIO_OUT); } diff --git a/boards/common/atmega/board.c b/boards/common/atmega/board.c index d951a24344..40f3ce1c71 100644 --- a/boards/common/atmega/board.c +++ b/boards/common/atmega/board.c @@ -19,14 +19,7 @@ */ #include "board.h" -#include "cpu.h" -#include "periph/gpio.h" - -void led_init(void); void __attribute__((weak)) board_init(void) { -#ifdef LED0_ON - led_init(); -#endif } diff --git a/boards/common/atxmega/board.c b/boards/common/atxmega/board.c index 7d4bdb24e4..dd639b3d1f 100644 --- a/boards/common/atxmega/board.c +++ b/boards/common/atxmega/board.c @@ -21,17 +21,6 @@ #include "board.h" #include "cpu.h" -#ifdef LED_PORT -void __attribute__((weak)) led_init(void) -{ - LED_PORT.DIR = LED_PORT_MASK; - LED_PORT.OUT = LED_PORT_MASK; -} -#endif - void __attribute__((weak)) board_init(void) { -#ifdef LED_PORT - led_init(); -#endif } diff --git a/boards/common/blxxxpill/board.c b/boards/common/blxxxpill/board.c index 75a0b2ab58..a99258aa66 100644 --- a/boards/common/blxxxpill/board.c +++ b/boards/common/blxxxpill/board.c @@ -27,5 +27,4 @@ void board_init(void) { - gpio_init(LED0_PIN, GPIO_OUT); } diff --git a/boards/common/e104-bt50xxa-tb/board.c b/boards/common/e104-bt50xxa-tb/board.c index 19e0fb7bdf..f77f6e4c7b 100644 --- a/boards/common/e104-bt50xxa-tb/board.c +++ b/boards/common/e104-bt50xxa-tb/board.c @@ -26,10 +26,6 @@ extern void pm_reboot(void*); void board_init(void) { - /* initialize the boards LEDs */ - LED_PORT->DIRSET = (LED_MASK); - LED_PORT->OUTSET = (LED_MASK); - /* configure software RST button */ #ifdef MODULE_BOARD_SOFTWARE_RESET gpio_init_int(BTN0_PIN, BTN0_MODE, GPIO_FALLING, diff --git a/boards/common/esp32/board_common.c b/boards/common/esp32/board_common.c index 42a05e2e01..b8955781f4 100644 --- a/boards/common/esp32/board_common.c +++ b/boards/common/esp32/board_common.c @@ -32,18 +32,6 @@ void board_init_common(void) { - #ifdef LED0_PIN - gpio_init (LED0_PIN, GPIO_OUT); - LED0_OFF; - #endif - #ifdef LED1_PIN - gpio_init (LED1_PIN, GPIO_OUT); - LED1_OFF; - #endif - #ifdef LED2_PIN - gpio_init (LED2_PIN, GPIO_OUT); - LED2_OFF; - #endif } extern void adc_print_config(void); diff --git a/boards/common/esp8266/board_common.c b/boards/common/esp8266/board_common.c index 942262791d..29591d4e61 100644 --- a/boards/common/esp8266/board_common.c +++ b/boards/common/esp8266/board_common.c @@ -29,18 +29,6 @@ extern "C" { void board_init(void) { - #ifdef LED0_PIN - gpio_init (LED0_PIN, GPIO_OUT); - LED0_OFF; - #endif - #ifdef LED1_PIN - gpio_init (LED1_PIN, GPIO_OUT); - LED1_OFF; - #endif - #ifdef LED2_PIN - gpio_init (LED2_PIN, GPIO_OUT); - LED2_OFF; - #endif } extern void adc_print_config(void); diff --git a/boards/common/iotlab/board_init.c b/boards/common/iotlab/board_init.c index 02a48dd9de..9c07e3e595 100644 --- a/boards/common/iotlab/board_init.c +++ b/boards/common/iotlab/board_init.c @@ -23,11 +23,4 @@ void board_init(void) { - /* initialize the boards LEDs and turn them off */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_set(LED0_PIN); - gpio_set(LED1_PIN); - gpio_set(LED2_PIN); } diff --git a/boards/common/kw41z/board.c b/boards/common/kw41z/board.c index 493ccd5997..0f882234b8 100644 --- a/boards/common/kw41z/board.c +++ b/boards/common/kw41z/board.c @@ -21,31 +21,6 @@ #include "board.h" #include "periph/gpio.h" -static void led_init(void) -{ - /* initialize and turn off LEDs */ -#ifdef LED0_PIN - gpio_init(LED0_PIN, GPIO_OUT); - LED0_OFF; -#endif -#ifdef LED1_PIN - gpio_init(LED1_PIN, GPIO_OUT); - LED1_OFF; -#endif -#ifdef LED2_PIN - gpio_init(LED2_PIN, GPIO_OUT); - LED2_OFF; -#endif -#ifdef LED3_PIN - gpio_init(LED3_PIN, GPIO_OUT); - LED3_OFF; -#endif -} - void board_init(void) { - /* initialize LEDs, skip for riotboot */ - if (!IS_ACTIVE(RIOTBOOT)) { - led_init(); - } } diff --git a/boards/common/nrf52xxxdk/board.c b/boards/common/nrf52xxxdk/board.c index ea1bd18b19..accba4e3d4 100644 --- a/boards/common/nrf52xxxdk/board.c +++ b/boards/common/nrf52xxxdk/board.c @@ -23,8 +23,4 @@ void board_init(void) { - /* initialize the boards LEDs */ - LED_PORT->DIRSET = (LED_MASK); - LED_PORT->OUTSET = (LED_MASK); - } diff --git a/boards/common/nucleo/board_common_nucleo_init.c b/boards/common/nucleo/board_common_nucleo_init.c index 4384ab3f75..806603326d 100644 --- a/boards/common/nucleo/board_common_nucleo_init.c +++ b/boards/common/nucleo/board_common_nucleo_init.c @@ -28,25 +28,6 @@ * @} */ -#include "board.h" -#include "board_nucleo.h" -#include "periph/gpio.h" - -void board_common_nucleo_init(void) -{ - /* initialization of on-board LEDs - * NOTE: LED0 must be explicitly enabled as it is also used for SPI_DEV(0) */ -#ifdef AUTO_INIT_LED0 - gpio_init(LED0_PIN, GPIO_OUT); -#endif -#ifdef LED1_PIN - gpio_init(LED1_PIN, GPIO_OUT); -#endif -#ifdef LED2_PIN - gpio_init(LED2_PIN, GPIO_OUT); -#endif -} - /* * Allow overwriting board_init if common implementation doesn't work. * If at link time another implementation of board_init() not marked as weak @@ -54,5 +35,4 @@ void board_common_nucleo_init(void) */ void __attribute__((weak)) board_init(void) { - board_common_nucleo_init(); } diff --git a/boards/common/nucleo/include/board_nucleo.h b/boards/common/nucleo/include/board_nucleo.h index b7e524fe89..3d59b504be 100644 --- a/boards/common/nucleo/include/board_nucleo.h +++ b/boards/common/nucleo/include/board_nucleo.h @@ -55,11 +55,6 @@ extern "C" { #endif /** @} */ -/** - * @brief Common board initialization routine for Nucleo boards - */ -void board_common_nucleo_init(void); - /** * @brief Initialize board specific hardware, including clock, LEDs and std-IO */ diff --git a/boards/common/nucleo144/include/board.h b/boards/common/nucleo144/include/board.h index 0623c181e4..4920fad4ec 100644 --- a/boards/common/nucleo144/include/board.h +++ b/boards/common/nucleo144/include/board.h @@ -69,11 +69,6 @@ extern "C" { #define LED2_ON (LED2_PORT->BSRR = LED2_MASK) #define LED2_OFF (LED2_PORT->BSRR = (LED2_MASK << 16)) #define LED2_TOGGLE (LED2_PORT->ODR ^= LED2_MASK) - -/* the Nucleo144 boards always use LED0, as there is no dual use of its pin */ -#ifndef AUTO_INIT_LED0 -#define AUTO_INIT_LED0 -#endif /** @} */ /** diff --git a/boards/common/nucleo32/Kconfig b/boards/common/nucleo32/Kconfig index bebcefa25e..552ff66158 100644 --- a/boards/common/nucleo32/Kconfig +++ b/boards/common/nucleo32/Kconfig @@ -12,5 +12,8 @@ config BOARD_COMMON_NUCLEO32 # Clock configuration select BOARD_HAS_LSE if (CPU_FAM_L0 || CPU_FAM_L4) && !BOARD_NUCLEO_L011K4 +config MODULE_PERIPH_INIT_LED0 + default n if MODULE_PERIPH_SPI + source "$(RIOTBOARD)/common/nucleo/Kconfig" source "$(RIOTBOARD)/common/stm32/Kconfig" diff --git a/boards/common/nucleo32/Makefile.dep b/boards/common/nucleo32/Makefile.dep new file mode 100644 index 0000000000..d9bc77f856 --- /dev/null +++ b/boards/common/nucleo32/Makefile.dep @@ -0,0 +1,6 @@ +ifneq (,$(filter periph_spi,$(USEMODULE))) + # The LED pin is also used for SPI + DISABLE_MODULE += periph_init_led0 +endif + +include $(RIOTBOARD)/common/nucleo/Makefile.dep diff --git a/boards/common/nucleo32/include/gpio_params.h b/boards/common/nucleo32/include/gpio_params.h index 49c91566f4..94f7a59e81 100644 --- a/boards/common/nucleo32/include/gpio_params.h +++ b/boards/common/nucleo32/include/gpio_params.h @@ -26,7 +26,7 @@ extern "C" { #endif -#ifndef AUTO_INIT_LED0 +#ifndef MODULE_PERIPH_INIT_LED0 #define SAUL_GPIO_NUMOF (0U) #else /** @@ -40,7 +40,7 @@ static const saul_gpio_params_t saul_gpio_params[] = .mode = GPIO_OUT } }; -#endif /* AUTO_INIT_LED0 */ +#endif /* MODULE_PERIPH_INIT_LED0 */ #ifdef __cplusplus } diff --git a/boards/common/nucleo64/Kconfig b/boards/common/nucleo64/Kconfig index 6c26da9faa..3b410fb4bd 100644 --- a/boards/common/nucleo64/Kconfig +++ b/boards/common/nucleo64/Kconfig @@ -13,5 +13,8 @@ config BOARD_COMMON_NUCLEO64 select BOARD_HAS_HSE if !CPU_FAM_G0 && !CPU_FAM_L0 && !CPU_FAM_L1 && !CPU_FAM_L4 select BOARD_HAS_LSE if !BOARD_NUCLEO_L152RE +config MODULE_PERIPH_INIT_LED0 + default n if MODULE_PERIPH_SPI + source "$(RIOTBOARD)/common/nucleo/Kconfig" source "$(RIOTBOARD)/common/stm32/Kconfig" diff --git a/boards/common/nucleo64/Makefile.dep b/boards/common/nucleo64/Makefile.dep new file mode 100644 index 0000000000..d9bc77f856 --- /dev/null +++ b/boards/common/nucleo64/Makefile.dep @@ -0,0 +1,6 @@ +ifneq (,$(filter periph_spi,$(USEMODULE))) + # The LED pin is also used for SPI + DISABLE_MODULE += periph_init_led0 +endif + +include $(RIOTBOARD)/common/nucleo/Makefile.dep diff --git a/boards/common/nucleo64/include/gpio_params.h b/boards/common/nucleo64/include/gpio_params.h index 6ccf295497..b9eb9f32b8 100644 --- a/boards/common/nucleo64/include/gpio_params.h +++ b/boards/common/nucleo64/include/gpio_params.h @@ -32,7 +32,7 @@ extern "C" { */ static const saul_gpio_params_t saul_gpio_params[] = { -#ifdef AUTO_INIT_LED0 +#ifdef MODULE_PERIPH_INIT_LED0 { .name = "LED(green)", .pin = LED0_PIN, diff --git a/boards/common/particle-mesh/board.c b/boards/common/particle-mesh/board.c index 74270ad364..2360a264b6 100644 --- a/boards/common/particle-mesh/board.c +++ b/boards/common/particle-mesh/board.c @@ -73,14 +73,6 @@ void post_startup(void) void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_set(LED0_PIN); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_set(LED1_PIN); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_set(LED2_PIN); - gpio_init(VCTL1_PIN, GPIO_OUT); #ifdef VCTL2_PIN /* On boards without VCLT2_PIN (Boron), the VCTL2 net is driven by NOT(VCTL1) */ @@ -88,5 +80,4 @@ void board_init(void) #endif board_nrfantenna_select(BOARD_NRFANTENNA_DEFAULT); - } diff --git a/boards/common/saml1x/board.c b/boards/common/saml1x/board.c index cbc9783568..648a95c0e6 100644 --- a/boards/common/saml1x/board.c +++ b/boards/common/saml1x/board.c @@ -19,24 +19,8 @@ * @} */ -#include "cpu.h" #include "board.h" -#include "periph/gpio.h" - -void led_init(void); void board_init(void) { - /* initialize the boards LEDs */ - led_init(); - -} - -/** - * @brief Initialize the boards on-board LED - */ -void led_init(void) -{ - gpio_init(LED0_PIN, GPIO_OUT); - LED0_OFF; } diff --git a/boards/common/silabs/board_common.c b/boards/common/silabs/board_common.c index e187265645..cf08f48a19 100644 --- a/boards/common/silabs/board_common.c +++ b/boards/common/silabs/board_common.c @@ -42,10 +42,6 @@ void board_common_init(void) bc_init(); #endif - /* initialize the LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - /* initialize the push buttons */ gpio_init(PB0_PIN, GPIO_IN); gpio_init(PB1_PIN, GPIO_IN); diff --git a/boards/common/sodaq/board.c b/boards/common/sodaq/board.c index 5a8fce8665..ab3edbde58 100644 --- a/boards/common/sodaq/board.c +++ b/boards/common/sodaq/board.c @@ -23,7 +23,4 @@ void board_init(void) { - /* initialize the on-board LED */ - gpio_init(LED0_PIN, GPIO_OUT); - } diff --git a/boards/common/weact-f4x1cx/board.c b/boards/common/weact-f4x1cx/board.c index fc772669e9..8fcf933f6e 100644 --- a/boards/common/weact-f4x1cx/board.c +++ b/boards/common/weact-f4x1cx/board.c @@ -56,6 +56,4 @@ mtd_dev_t *mtd0 = (mtd_dev_t *)&weact_nor_dev; void board_init(void) { - gpio_init(LED0_PIN, GPIO_OUT); - LED0_OFF; } diff --git a/boards/dwm1001/board.c b/boards/dwm1001/board.c index dc2c9e5a6d..0665000202 100644 --- a/boards/dwm1001/board.c +++ b/boards/dwm1001/board.c @@ -25,13 +25,4 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_set(LED0_PIN); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_set(LED1_PIN); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_set(LED2_PIN); - gpio_init(LED3_PIN, GPIO_OUT); - gpio_set(LED3_PIN); } diff --git a/boards/e180-zg120b-tb/board.c b/boards/e180-zg120b-tb/board.c index 183c641daa..4c10238a83 100644 --- a/boards/e180-zg120b-tb/board.c +++ b/boards/e180-zg120b-tb/board.c @@ -24,10 +24,6 @@ void board_init(void) { #ifndef RIOTBOOT - /* initialize the LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - /* initialize the push buttons */ gpio_init(PB0_PIN, GPIO_IN); gpio_init(PB1_PIN, GPIO_IN); diff --git a/boards/ek-lm4f120xl/board.c b/boards/ek-lm4f120xl/board.c index 9014b1f9c4..31b4bd8b1c 100644 --- a/boards/ek-lm4f120xl/board.c +++ b/boards/ek-lm4f120xl/board.c @@ -19,23 +19,7 @@ */ #include "board.h" -static void leds_init(void); void board_init(void) { - /* initialize the boards LEDs, this is done for debugging purpose */ - leds_init(); - -} - -/** - * @brief initialize the boards on-boards LEDS. - */ -static void leds_init(void) -{ - /* enable clock for PORTF */ - ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); - - /*configure the pins as general output */ - ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3); } diff --git a/boards/f4vi1/board.c b/boards/f4vi1/board.c index e0dd69a47d..da9593f120 100644 --- a/boards/f4vi1/board.c +++ b/boards/f4vi1/board.c @@ -24,8 +24,4 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); } diff --git a/boards/feather-m0/board.c b/boards/feather-m0/board.c index 59fabea361..8ffc970327 100644 --- a/boards/feather-m0/board.c +++ b/boards/feather-m0/board.c @@ -24,6 +24,4 @@ void board_init(void) { - /* initialize the on-board red LED on pin PA17 */ - gpio_init(LED0_PIN, GPIO_OUT); } diff --git a/boards/feather-nrf52840/board.c b/boards/feather-nrf52840/board.c index a424d7971a..80108843f3 100644 --- a/boards/feather-nrf52840/board.c +++ b/boards/feather-nrf52840/board.c @@ -20,12 +20,6 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_clear(LED0_PIN); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_clear(LED1_PIN); - } /** @} */ diff --git a/boards/firefly/board.c b/boards/firefly/board.c index 863e1a562e..636f560e10 100644 --- a/boards/firefly/board.c +++ b/boards/firefly/board.c @@ -26,7 +26,6 @@ static inline void leds_init(void); void board_init(void) { - /* initialize the boards LEDs */ leds_init(); } @@ -38,10 +37,6 @@ void board_init(void) */ static inline void leds_init(void) { - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - /* Shoot rainbows */ LED_RAINBOW(); } diff --git a/boards/frdm-k22f/board.c b/boards/frdm-k22f/board.c index 4874ed8d18..26f45187c3 100644 --- a/boards/frdm-k22f/board.c +++ b/boards/frdm-k22f/board.c @@ -25,11 +25,4 @@ void board_init(void) { - /* initialize and turn off the on-board RGB-LED */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_set(LED0_PIN); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_set(LED1_PIN); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_set(LED2_PIN); } diff --git a/boards/frdm-k64f/board.c b/boards/frdm-k64f/board.c index 785d0632f5..a328efc479 100644 --- a/boards/frdm-k64f/board.c +++ b/boards/frdm-k64f/board.c @@ -27,13 +27,4 @@ void board_init(void) /* RMII RXCLK pin configuration */ SIM->SCGC5 |= SIM_SCGC5_PORTA_MASK; PORTA->PCR[18] &= ~(PORT_PCR_ISF_MASK | PORT_PCR_MUX(0x07)); - - - /* initialize and turn off the on-board RGB-LED */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_set(LED0_PIN); - gpio_set(LED1_PIN); - gpio_set(LED2_PIN); } diff --git a/boards/frdm-kl43z/board.c b/boards/frdm-kl43z/board.c index 253325c953..3b6a535a41 100644 --- a/boards/frdm-kl43z/board.c +++ b/boards/frdm-kl43z/board.c @@ -23,9 +23,4 @@ void board_init(void) { - /* initialize and turn off the on-board RGB-LED */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_set(LED0_PIN); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_set(LED1_PIN); } diff --git a/boards/hamilton/board.c b/boards/hamilton/board.c index 8b1c4c1d87..bd50e0c125 100644 --- a/boards/hamilton/board.c +++ b/boards/hamilton/board.c @@ -25,7 +25,4 @@ void board_init(void) { - /* initialize the on-board LED */ - gpio_init(LED0_PIN, GPIO_OUT); - } diff --git a/boards/hifive1/board.c b/boards/hifive1/board.c index b738361be5..7a84836d40 100644 --- a/boards/hifive1/board.c +++ b/boards/hifive1/board.c @@ -24,13 +24,4 @@ void board_init(void) { - /* Configure GPIOs for LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - - /* Turn all the LEDs off */ - LED0_OFF; - LED1_OFF; - LED2_OFF; } diff --git a/boards/hifive1b/board.c b/boards/hifive1b/board.c index 792485988c..c4b97df284 100644 --- a/boards/hifive1b/board.c +++ b/boards/hifive1b/board.c @@ -24,13 +24,4 @@ void board_init(void) { - /* Configure GPIOs for LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - - /* Turn all the LEDs off */ - LED0_OFF; - LED1_OFF; - LED2_OFF; } diff --git a/boards/ikea-tradfri/board.c b/boards/ikea-tradfri/board.c index 2b7df58d59..42786d08ca 100644 --- a/boards/ikea-tradfri/board.c +++ b/boards/ikea-tradfri/board.c @@ -55,12 +55,6 @@ mtd_dev_t *mtd0 = (mtd_dev_t *)&ikea_tradfri_nor_dev; void board_init(void) { -#ifndef RIOTBOOT - /* initialize the LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); -#endif - #ifdef MODULE_MTD /* enable NOR flash (only on the ICC-1-A) */ if (gpio_is_valid(IKEA_TRADFRI_NOR_EN)) { diff --git a/boards/limifrog-v1/board.c b/boards/limifrog-v1/board.c index 7bf9cbe4eb..65a158d925 100644 --- a/boards/limifrog-v1/board.c +++ b/boards/limifrog-v1/board.c @@ -23,6 +23,4 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); } diff --git a/boards/lobaro-lorabox/board.c b/boards/lobaro-lorabox/board.c index fb67d1867a..e936e3abdf 100644 --- a/boards/lobaro-lorabox/board.c +++ b/boards/lobaro-lorabox/board.c @@ -22,6 +22,5 @@ void board_init(void) { - gpio_init(LED0_PIN, GPIO_OUT); gpio_init(EN3V3_PIN, GPIO_OUT); } diff --git a/boards/lora-e5-dev/board.c b/boards/lora-e5-dev/board.c index b3a9421aad..1f8e9fbaed 100644 --- a/boards/lora-e5-dev/board.c +++ b/boards/lora-e5-dev/board.c @@ -30,12 +30,6 @@ void board_init(void) { - /* initialization of on-board LEDs */ -#ifdef AUTO_INIT_LED0 - gpio_init(LED0_PIN, GPIO_OUT); - LED0_OFF; -#endif - if(IS_ACTIVE(CONFIG_LORA_E5_DEV_ENABLE_3P3V)) { gpio_init(LORA_E5_DEV_3P3V_ENABLE_PIN, GPIO_OUT); gpio_set(LORA_E5_DEV_3P3V_ENABLE_PIN); diff --git a/boards/lora-e5-dev/include/board.h b/boards/lora-e5-dev/include/board.h index 5e18636b6a..55f3efd16d 100644 --- a/boards/lora-e5-dev/include/board.h +++ b/boards/lora-e5-dev/include/board.h @@ -54,15 +54,6 @@ extern void lora_e5_dev_sx126x_set_rf_mode(sx126x_t *dev, sx126x_rf_mode_t rf_mo #define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK) /** @} */ -/** - * @brief Lora-E5-Dev always use LED0, as there is no dual use of its pin - * @{ - */ -#ifndef AUTO_INIT_LED0 -#define AUTO_INIT_LED0 -#endif -/** @} */ - /** * @name User button * @{ diff --git a/boards/lora-e5-dev/include/gpio_params.h b/boards/lora-e5-dev/include/gpio_params.h index 9c579ceb7f..de7ff3b933 100644 --- a/boards/lora-e5-dev/include/gpio_params.h +++ b/boards/lora-e5-dev/include/gpio_params.h @@ -32,13 +32,11 @@ extern "C" { */ static const saul_gpio_params_t saul_gpio_params[] = { -#ifdef AUTO_INIT_LED0 { .name = "LED(red)", .pin = LED0_PIN, .mode = GPIO_OUT }, -#endif { .name = "Button(B1 Boot)", .pin = BTN0_PIN, diff --git a/boards/maple-mini/board.c b/boards/maple-mini/board.c index d0873d6442..64f4bc462a 100644 --- a/boards/maple-mini/board.c +++ b/boards/maple-mini/board.c @@ -23,6 +23,4 @@ void board_init(void) { - /* initialize the boards LED */ - gpio_init(LED0_PIN, GPIO_OUT); } diff --git a/boards/mbed_lpc1768/board.c b/boards/mbed_lpc1768/board.c index e9a90546cd..2b3c67ee8d 100644 --- a/boards/mbed_lpc1768/board.c +++ b/boards/mbed_lpc1768/board.c @@ -25,26 +25,8 @@ extern void SystemInit(void); -/** - * @brief Initialize the on-board LEDs. - */ -static void leds_init(void) -{ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_init(LED3_PIN, GPIO_OUT); - - LED0_OFF; - LED1_OFF; - LED2_OFF; - LED3_OFF; -} - void board_init(void) { /* initialize core clocks via CMSIS function */ SystemInit(); - /* initialize the boards LEDs */ - leds_init(); } diff --git a/boards/mcb2388/board_init.c b/boards/mcb2388/board_init.c index 77b1a0ca14..856ae58998 100644 --- a/boards/mcb2388/board_init.c +++ b/boards/mcb2388/board_init.c @@ -24,7 +24,6 @@ #include "cpu.h" #include "mtd.h" #include "periph/init.h" -#include "stdio_base.h" #ifdef MODULE_MTD_MCI extern const mtd_desc_t mtd_mci_driver; @@ -34,7 +33,4 @@ mtd_dev_t *mtd0 = &_mtd_mci; void board_init(void) { - /* LEDS */ - FIO2DIR |= LED0_MASK | LED1_MASK | LED2_MASK | LED3_MASK \ - | LED4_MASK | LED5_MASK | LED6_MASK | LED7_MASK; } diff --git a/boards/mega-xplained/led_init.c b/boards/mega-xplained/led_init.c deleted file mode 100644 index a45924cc08..0000000000 --- a/boards/mega-xplained/led_init.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2014 Freie Universität Berlin, Hinnerk van Bruinehsen - * 2015-18 Kaspar Schleiser - * 2016 Laurent Navet - * 2018 Matthew Blue - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @ingroup boards_mega-xplained - * @{ - * - * @file - * @brief Board specific implementation for the Mega Xplained - * - * @author Hinnerk van Bruinehsen - * @author Kaspar Schleiser - * @author Laurent Navet - * @author Matthew Blue - * - * @} - */ - -#include "board.h" - -void led_init(void) -{ - /* LED0,2 currently unsupported due to lack of GPIO_OD support */ - - LED1_ENABLE_PORT; - LED1_OFF; - - LED3_ENABLE_PORT; - LED3_OFF; -} diff --git a/boards/msba2/board_init.c b/boards/msba2/board_init.c index bffbfee3a4..f5c2411e9a 100644 --- a/boards/msba2/board_init.c +++ b/boards/msba2/board_init.c @@ -38,10 +38,4 @@ mtd_dev_t *mtd0 = &_mtd_mci; void board_init(void) { - /* LEDS */ - FIO3DIR |= LED0_MASK; - FIO3DIR |= LED1_MASK; - - LED0_OFF; - LED0_OFF; } diff --git a/boards/msbiot/board.c b/boards/msbiot/board.c index 74e925e2a5..ed68fcad54 100644 --- a/boards/msbiot/board.c +++ b/boards/msbiot/board.c @@ -25,7 +25,6 @@ static void gpios_init(void); void board_init(void) { - /* initialize the boards LEDs */ gpios_init(); } @@ -44,9 +43,6 @@ void board_init(void) */ static void gpios_init(void) { - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); gpio_init(BUTTON0_PIN, GPIO_IN); gpio_init(BUTTON1_PIN, GPIO_IN); } diff --git a/boards/mulle/board.c b/boards/mulle/board.c index e9d5a9e047..c1c4d2876e 100644 --- a/boards/mulle/board.c +++ b/boards/mulle/board.c @@ -93,10 +93,6 @@ void board_init(void) { int status; - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); /* Initialize power control pins */ power_pins_init(); diff --git a/boards/native/board_init.c b/boards/native/board_init.c index a50e5f130c..6f91c5c515 100644 --- a/boards/native/board_init.c +++ b/boards/native/board_init.c @@ -78,8 +78,5 @@ VFS_AUTO_MOUNT(fatfs, VFS_MTD(mtd0_dev), "/nvm", 0); */ void board_init(void) { - LED0_OFF; - LED1_ON; - puts("RIOT native board initialized."); } diff --git a/boards/nrf51dk/board.c b/boards/nrf51dk/board.c index 9afd7dcc73..f39d6d3ee9 100644 --- a/boards/nrf51dk/board.c +++ b/boards/nrf51dk/board.c @@ -23,20 +23,9 @@ void board_init(void) { - /* initialize the board LEDs, set pins as output and turn LEDs off */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_init(LED3_PIN, GPIO_OUT); - gpio_set(LED0_PIN); - gpio_set(LED1_PIN); - gpio_set(LED2_PIN); - gpio_set(LED3_PIN); - /* initialize the board buttons */ gpio_init(BTN0_PIN, BTN0_MODE); gpio_init(BTN1_PIN, BTN1_MODE); gpio_init(BTN2_PIN, BTN2_MODE); gpio_init(BTN3_PIN, BTN3_MODE); - } diff --git a/boards/nrf51dongle/board.c b/boards/nrf51dongle/board.c index bd6ca1debf..f391dfc120 100644 --- a/boards/nrf51dongle/board.c +++ b/boards/nrf51dongle/board.c @@ -23,9 +23,5 @@ void board_init(void) { - /* initialize the boards LEDs, set pins as output and turn LEDs off */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); } diff --git a/boards/nrf52832-mdk/board.c b/boards/nrf52832-mdk/board.c index 7f0dcdc516..dd4aeeed2c 100644 --- a/boards/nrf52832-mdk/board.c +++ b/boards/nrf52832-mdk/board.c @@ -25,12 +25,5 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_set(LED0_PIN); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_set(LED1_PIN); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_set(LED2_PIN); } diff --git a/boards/nrf52840-mdk-dongle/board.c b/boards/nrf52840-mdk-dongle/board.c index 819eb06d92..2e133cba0f 100644 --- a/boards/nrf52840-mdk-dongle/board.c +++ b/boards/nrf52840-mdk-dongle/board.c @@ -25,12 +25,5 @@ void board_init(void) { - /* initialize the board's RGB LED */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_set(LED0_PIN); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_set(LED1_PIN); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_set(LED2_PIN); } diff --git a/boards/nrf52840-mdk/board.c b/boards/nrf52840-mdk/board.c index 930a08fdaa..a089a38d1c 100644 --- a/boards/nrf52840-mdk/board.c +++ b/boards/nrf52840-mdk/board.c @@ -25,12 +25,5 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_set(LED0_PIN); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_set(LED1_PIN); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_set(LED2_PIN); } diff --git a/boards/nrf52840dongle/board.c b/boards/nrf52840dongle/board.c index fc12b6507f..066d6ad877 100644 --- a/boards/nrf52840dongle/board.c +++ b/boards/nrf52840dongle/board.c @@ -25,16 +25,6 @@ void board_init(void) { - /* initialize the board's single LED */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_set(LED0_PIN); - /* initialize the board's RGB LED */ - gpio_init(LED1_PIN, GPIO_OUT); - gpio_set(LED1_PIN); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_set(LED2_PIN); - gpio_init(LED3_PIN, GPIO_OUT); - gpio_set(LED3_PIN); } diff --git a/boards/nrf6310/board.c b/boards/nrf6310/board.c index b6023693fd..3df8edffc8 100644 --- a/boards/nrf6310/board.c +++ b/boards/nrf6310/board.c @@ -28,5 +28,4 @@ void board_init(void) /* initialize and turn off on-board LEDs */ NRF_GPIO->DIRSET = (LED0_MASK | LED1_MASK | LED2_MASK); NRF_GPIO->OUTSET = (LED0_MASK | LED1_MASK | LED2_MASK); - } diff --git a/boards/nrf9160dk/board.c b/boards/nrf9160dk/board.c index cb6c6d09c7..3da2963715 100644 --- a/boards/nrf9160dk/board.c +++ b/boards/nrf9160dk/board.c @@ -24,14 +24,6 @@ void board_init(void) { - gpio_init(LED0_PIN, GPIO_OUT); - gpio_clear(LED0_PIN); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_clear(LED1_PIN); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_clear(LED2_PIN); - gpio_init(LED3_PIN, GPIO_OUT); - gpio_clear(LED3_PIN); gpio_init(BTN0_PIN, BTN0_MODE); gpio_init(BTN1_PIN, BTN1_MODE); diff --git a/boards/nucleo-f030r8/Makefile.dep b/boards/nucleo-f030r8/Makefile.dep index 7294858272..dbfbd3bd20 100644 --- a/boards/nucleo-f030r8/Makefile.dep +++ b/boards/nucleo-f030r8/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-f031k6/Makefile.dep b/boards/nucleo-f031k6/Makefile.dep index 7294858272..8db84f184d 100644 --- a/boards/nucleo-f031k6/Makefile.dep +++ b/boards/nucleo-f031k6/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo32/Makefile.dep diff --git a/boards/nucleo-f042k6/Makefile.dep b/boards/nucleo-f042k6/Makefile.dep index 7294858272..8db84f184d 100644 --- a/boards/nucleo-f042k6/Makefile.dep +++ b/boards/nucleo-f042k6/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo32/Makefile.dep diff --git a/boards/nucleo-f070rb/Makefile.dep b/boards/nucleo-f070rb/Makefile.dep index 7294858272..dbfbd3bd20 100644 --- a/boards/nucleo-f070rb/Makefile.dep +++ b/boards/nucleo-f070rb/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-f072rb/Makefile.dep b/boards/nucleo-f072rb/Makefile.dep index 7294858272..dbfbd3bd20 100644 --- a/boards/nucleo-f072rb/Makefile.dep +++ b/boards/nucleo-f072rb/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-f091rc/Makefile.dep b/boards/nucleo-f091rc/Makefile.dep index 7294858272..dbfbd3bd20 100644 --- a/boards/nucleo-f091rc/Makefile.dep +++ b/boards/nucleo-f091rc/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-f103rb/Makefile.dep b/boards/nucleo-f103rb/Makefile.dep index 7294858272..dbfbd3bd20 100644 --- a/boards/nucleo-f103rb/Makefile.dep +++ b/boards/nucleo-f103rb/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-f302r8/Makefile.dep b/boards/nucleo-f302r8/Makefile.dep index 7294858272..dbfbd3bd20 100644 --- a/boards/nucleo-f302r8/Makefile.dep +++ b/boards/nucleo-f302r8/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-f303k8/Makefile.dep b/boards/nucleo-f303k8/Makefile.dep index 7294858272..8db84f184d 100644 --- a/boards/nucleo-f303k8/Makefile.dep +++ b/boards/nucleo-f303k8/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo32/Makefile.dep diff --git a/boards/nucleo-f303re/Makefile.dep b/boards/nucleo-f303re/Makefile.dep index 7294858272..dbfbd3bd20 100644 --- a/boards/nucleo-f303re/Makefile.dep +++ b/boards/nucleo-f303re/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-f334r8/Makefile.dep b/boards/nucleo-f334r8/Makefile.dep index 7294858272..dbfbd3bd20 100644 --- a/boards/nucleo-f334r8/Makefile.dep +++ b/boards/nucleo-f334r8/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-f401re/Makefile.dep b/boards/nucleo-f401re/Makefile.dep index 7294858272..dbfbd3bd20 100644 --- a/boards/nucleo-f401re/Makefile.dep +++ b/boards/nucleo-f401re/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-f410rb/Makefile.dep b/boards/nucleo-f410rb/Makefile.dep index 7294858272..dbfbd3bd20 100644 --- a/boards/nucleo-f410rb/Makefile.dep +++ b/boards/nucleo-f410rb/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-f411re/Makefile.dep b/boards/nucleo-f411re/Makefile.dep index 7294858272..dbfbd3bd20 100644 --- a/boards/nucleo-f411re/Makefile.dep +++ b/boards/nucleo-f411re/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-f446re/Makefile.dep b/boards/nucleo-f446re/Makefile.dep index 7294858272..dbfbd3bd20 100644 --- a/boards/nucleo-f446re/Makefile.dep +++ b/boards/nucleo-f446re/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-g070rb/Makefile.dep b/boards/nucleo-g070rb/Makefile.dep index 7294858272..dbfbd3bd20 100644 --- a/boards/nucleo-g070rb/Makefile.dep +++ b/boards/nucleo-g070rb/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-g071rb/Makefile.dep b/boards/nucleo-g071rb/Makefile.dep index 7294858272..dbfbd3bd20 100644 --- a/boards/nucleo-g071rb/Makefile.dep +++ b/boards/nucleo-g071rb/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-g431rb/Makefile.dep b/boards/nucleo-g431rb/Makefile.dep index 2f80f9d9bb..d74edbdf58 100644 --- a/boards/nucleo-g431rb/Makefile.dep +++ b/boards/nucleo-g431rb/Makefile.dep @@ -1,4 +1,5 @@ ifneq (,$(filter stdio_uart,$(USEMODULE))) FEATURES_REQUIRED += periph_lpuart endif -include $(RIOTBOARD)/common/nucleo/Makefile.dep + +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-g474re/Makefile.dep b/boards/nucleo-g474re/Makefile.dep index 2f80f9d9bb..d74edbdf58 100644 --- a/boards/nucleo-g474re/Makefile.dep +++ b/boards/nucleo-g474re/Makefile.dep @@ -1,4 +1,5 @@ ifneq (,$(filter stdio_uart,$(USEMODULE))) FEATURES_REQUIRED += periph_lpuart endif -include $(RIOTBOARD)/common/nucleo/Makefile.dep + +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-l011k4/Makefile.dep b/boards/nucleo-l011k4/Makefile.dep index cb66ca7c2b..d912f15ffc 100644 --- a/boards/nucleo-l011k4/Makefile.dep +++ b/boards/nucleo-l011k4/Makefile.dep @@ -1,4 +1,4 @@ # Use Picolibc to reduce ROM usage FEATURES_REQUIRED += picolibc -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo32/Makefile.dep diff --git a/boards/nucleo-l031k6/Makefile.dep b/boards/nucleo-l031k6/Makefile.dep index 7294858272..8db84f184d 100644 --- a/boards/nucleo-l031k6/Makefile.dep +++ b/boards/nucleo-l031k6/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo32/Makefile.dep diff --git a/boards/nucleo-l053r8/Makefile.dep b/boards/nucleo-l053r8/Makefile.dep index 7294858272..dbfbd3bd20 100644 --- a/boards/nucleo-l053r8/Makefile.dep +++ b/boards/nucleo-l053r8/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-l073rz/Makefile.dep b/boards/nucleo-l073rz/Makefile.dep index 7294858272..dbfbd3bd20 100644 --- a/boards/nucleo-l073rz/Makefile.dep +++ b/boards/nucleo-l073rz/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-l152re/Makefile.dep b/boards/nucleo-l152re/Makefile.dep index 7294858272..dbfbd3bd20 100644 --- a/boards/nucleo-l152re/Makefile.dep +++ b/boards/nucleo-l152re/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-l412kb/Makefile.dep b/boards/nucleo-l412kb/Makefile.dep index 7294858272..8db84f184d 100644 --- a/boards/nucleo-l412kb/Makefile.dep +++ b/boards/nucleo-l412kb/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo32/Makefile.dep diff --git a/boards/nucleo-l432kc/Makefile.dep b/boards/nucleo-l432kc/Makefile.dep index 7294858272..8db84f184d 100644 --- a/boards/nucleo-l432kc/Makefile.dep +++ b/boards/nucleo-l432kc/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo32/Makefile.dep diff --git a/boards/nucleo-l433rc/Makefile.dep b/boards/nucleo-l433rc/Makefile.dep index 2f80f9d9bb..d74edbdf58 100644 --- a/boards/nucleo-l433rc/Makefile.dep +++ b/boards/nucleo-l433rc/Makefile.dep @@ -1,4 +1,5 @@ ifneq (,$(filter stdio_uart,$(USEMODULE))) FEATURES_REQUIRED += periph_lpuart endif -include $(RIOTBOARD)/common/nucleo/Makefile.dep + +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-l452re/Makefile.dep b/boards/nucleo-l452re/Makefile.dep index 7294858272..dbfbd3bd20 100644 --- a/boards/nucleo-l452re/Makefile.dep +++ b/boards/nucleo-l452re/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-l476rg/Makefile.dep b/boards/nucleo-l476rg/Makefile.dep index 7294858272..dbfbd3bd20 100644 --- a/boards/nucleo-l476rg/Makefile.dep +++ b/boards/nucleo-l476rg/Makefile.dep @@ -1 +1 @@ -include $(RIOTBOARD)/common/nucleo/Makefile.dep +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-wl55jc/Makefile.dep b/boards/nucleo-wl55jc/Makefile.dep index cd146179a3..8c23bb7579 100644 --- a/boards/nucleo-wl55jc/Makefile.dep +++ b/boards/nucleo-wl55jc/Makefile.dep @@ -7,4 +7,5 @@ endif ifneq (,$(filter sx126x_stm32wl,$(USEMODULE))) USEMODULE += sx126x_rf_switch endif -include $(RIOTBOARD)/common/nucleo/Makefile.dep + +include $(RIOTBOARD)/common/nucleo64/Makefile.dep diff --git a/boards/nucleo-wl55jc/board.c b/boards/nucleo-wl55jc/board.c index 1e3865df0a..49fe7bd9a5 100644 --- a/boards/nucleo-wl55jc/board.c +++ b/boards/nucleo-wl55jc/board.c @@ -26,9 +26,6 @@ void board_init(void) { - /* initialize the CPU */ - board_common_nucleo_init(); - if (IS_USED(MODULE_SX126X_STM32WL)) { /* Initialize the GPIO control for RF 3-port switch (SP3T) */ gpio_init(FE_CTRL1, GPIO_OUT); diff --git a/boards/nucleo-wl55jc/include/board.h b/boards/nucleo-wl55jc/include/board.h index 503b5adcfb..7f20224a16 100644 --- a/boards/nucleo-wl55jc/include/board.h +++ b/boards/nucleo-wl55jc/include/board.h @@ -70,15 +70,6 @@ extern void nucleo_wl55jc_sx126x_set_rf_mode(sx126x_t *dev, sx126x_rf_mode_t rf_ #define LED2_TOGGLE (LED0_PORT->ODR ^= LED2_MASK) /** @} */ -/** - * @brief Nucleo-wl55jc always use LED0, as there is no dual use of its pin - * @{ - */ -#ifndef AUTO_INIT_LED0 -#define AUTO_INIT_LED0 -#endif -/** @} */ - /** * @name User button * @{ diff --git a/boards/nucleo-wl55jc/include/gpio_params.h b/boards/nucleo-wl55jc/include/gpio_params.h index f464422bb3..dd2c080b9a 100644 --- a/boards/nucleo-wl55jc/include/gpio_params.h +++ b/boards/nucleo-wl55jc/include/gpio_params.h @@ -33,13 +33,11 @@ extern "C" { */ static const saul_gpio_params_t saul_gpio_params[] = { -#ifdef AUTO_INIT_LED0 { .name = "LED(blue)", .pin = LED0_PIN, .mode = GPIO_OUT }, -#endif { .name = "LED(green)", .pin = LED1_PIN, diff --git a/boards/nz32-sc151/board.c b/boards/nz32-sc151/board.c index 7524880a5b..96347ad85a 100644 --- a/boards/nz32-sc151/board.c +++ b/boards/nz32-sc151/board.c @@ -23,6 +23,4 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); } diff --git a/boards/olimexino-stm32/board.c b/boards/olimexino-stm32/board.c index ae345ae13c..57b9eb4e45 100644 --- a/boards/olimexino-stm32/board.c +++ b/boards/olimexino-stm32/board.c @@ -21,9 +21,6 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); /* initialize the button */ gpio_init(BTN0_PIN, BTN0_MODE); diff --git a/boards/omote/board.c b/boards/omote/board.c index 527f2b882f..55e6e5fb9b 100644 --- a/boards/omote/board.c +++ b/boards/omote/board.c @@ -18,26 +18,10 @@ #include "board.h" #include "cpu.h" -static inline void leds_init(void); - void board_init(void) { - /* initialize the boards LEDs */ - leds_init(); /* The boot pin must be set to input otherwise it may lock the bootloader */ gpio_init(BOOT_PIN, GPIO_IN); gpio_init(BTN0_PIN, BTN0_MODE); } - -/** - * @brief Initialize the boards on-board LEDs - * - * The LED initialization is hard-coded in this function. As the LEDs are - * soldered onto the board they are fixed to their CPU pins. - */ -static inline void leds_init(void) -{ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); -} diff --git a/boards/opencm904/board.c b/boards/opencm904/board.c index db5e3768db..1f003c9a06 100644 --- a/boards/opencm904/board.c +++ b/boards/opencm904/board.c @@ -24,9 +24,6 @@ void board_init(void) { - /* initialize the board's LED */ - gpio_init(LED0_PIN, GPIO_OUT); - LED0_OFF; /* disable bootloader's USB */ RCC->APB1ENR &= ~RCC_APB1ENR_USBEN; diff --git a/boards/openlabs-kw41z-mini/board.c b/boards/openlabs-kw41z-mini/board.c index a2dc95e8de..b0a5bb5e2b 100644 --- a/boards/openlabs-kw41z-mini/board.c +++ b/boards/openlabs-kw41z-mini/board.c @@ -24,9 +24,6 @@ void board_init(void) { - /* initialize and turn off LEDs */ - LED0_OFF; - gpio_init(LED0_PIN, GPIO_OUT); /* enable OSCERCLK output on PTB3 */ #if PTB3_OUTPUT_OSCERCLK diff --git a/boards/openmote-b/board.c b/boards/openmote-b/board.c index 1b2ef1a1c9..9550cebef8 100644 --- a/boards/openmote-b/board.c +++ b/boards/openmote-b/board.c @@ -24,11 +24,6 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_init(LED3_PIN, GPIO_OUT); /* The boot pin must be set to input otherwise it may lock the bootloader */ gpio_init(BOOT_PIN, GPIO_IN); diff --git a/boards/openmote-cc2538/board.c b/boards/openmote-cc2538/board.c index 37e301a07a..388f186179 100644 --- a/boards/openmote-cc2538/board.c +++ b/boards/openmote-cc2538/board.c @@ -23,10 +23,5 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_init(LED3_PIN, GPIO_OUT); } diff --git a/boards/p-l496g-cell02/board.c b/boards/p-l496g-cell02/board.c index f7f7631a36..e4dc396e41 100644 --- a/boards/p-l496g-cell02/board.c +++ b/boards/p-l496g-cell02/board.c @@ -23,7 +23,4 @@ void board_init(void) { - /* initialize LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); } diff --git a/boards/p-nucleo-wb55/include/board.h b/boards/p-nucleo-wb55/include/board.h index 3a4cb5021b..e4a7eeb3be 100644 --- a/boards/p-nucleo-wb55/include/board.h +++ b/boards/p-nucleo-wb55/include/board.h @@ -51,12 +51,6 @@ extern "C" { #define LED2_TOGGLE (LED0_PORT->ODR ^= LED2_MASK) /** @} */ -/* p-nucleo-wb55 always use LED0, as there is no dual use of its pin */ -#ifndef AUTO_INIT_LED0 -#define AUTO_INIT_LED0 -#endif -/** @} */ - /** * @name User button * @{ diff --git a/boards/p-nucleo-wb55/include/gpio_params.h b/boards/p-nucleo-wb55/include/gpio_params.h index 3dece7f8f6..b020a880ad 100644 --- a/boards/p-nucleo-wb55/include/gpio_params.h +++ b/boards/p-nucleo-wb55/include/gpio_params.h @@ -33,13 +33,11 @@ extern "C" { */ static const saul_gpio_params_t saul_gpio_params[] = { -#ifdef AUTO_INIT_LED0 { .name = "LED(blue)", .pin = LED0_PIN, .mode = GPIO_OUT }, -#endif { .name = "LED(green)", .pin = LED1_PIN, diff --git a/boards/pba-d-01-kw2x/board.c b/boards/pba-d-01-kw2x/board.c index ba4241931c..da6273944d 100644 --- a/boards/pba-d-01-kw2x/board.c +++ b/boards/pba-d-01-kw2x/board.c @@ -56,14 +56,5 @@ static inline void modem_clock_init(void) void board_init(void) { - /* initialize the on-board LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_set(LED0_PIN); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_set(LED1_PIN); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_set(LED2_PIN); - modem_clock_init(); - } diff --git a/boards/phynode-kw41z/board.c b/boards/phynode-kw41z/board.c index c3fce2b7c4..f13d75a4c8 100644 --- a/boards/phynode-kw41z/board.c +++ b/boards/phynode-kw41z/board.c @@ -25,23 +25,6 @@ void board_init(void) { - /* initialize and turn off LEDs */ -#ifdef LED0_PIN - gpio_init(LED0_PIN, GPIO_OUT); - gpio_set(LED0_PIN); -#endif -#ifdef LED1_PIN - gpio_init(LED1_PIN, GPIO_OUT); - gpio_set(LED1_PIN); -#endif -#ifdef LED2_PIN - gpio_init(LED2_PIN, GPIO_OUT); - gpio_set(LED2_PIN); -#endif -#ifdef LED3_PIN - gpio_init(LED3_PIN, GPIO_OUT); - gpio_set(LED3_PIN); -#endif /* If further modules are supported (e.g. HDC1010 sensor or the EPD) they have * to be added here so V_PERIPH pin is set and the devices are powered */ #if defined(MODULE_MMA8X5X) || defined(MODULE_TCS37727) || \ diff --git a/boards/pic32-wifire/wifire.c b/boards/pic32-wifire/wifire.c index 368f34e5eb..1565a3dc57 100644 --- a/boards/pic32-wifire/wifire.c +++ b/boards/pic32-wifire/wifire.c @@ -20,14 +20,6 @@ extern void dummy(void); void board_init(void) { /* Turn off all LED's */ - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_init(LED3_PIN, GPIO_OUT); - gpio_init(LED4_PIN, GPIO_OUT); - LED1_OFF; - LED2_OFF; - LED3_OFF; - LED4_OFF; /* Stop the linker from throwing away the PIC32 config register settings */ diff --git a/boards/pyboard/board.c b/boards/pyboard/board.c index 8d02322843..4c2911d6cb 100644 --- a/boards/pyboard/board.c +++ b/boards/pyboard/board.c @@ -25,6 +25,4 @@ void board_init(void) { - /* initialize LED */ - gpio_init(LED0_PIN, GPIO_OUT); } diff --git a/boards/qn9080dk/board.c b/boards/qn9080dk/board.c index 93ecd63ae0..6af89542d4 100644 --- a/boards/qn9080dk/board.c +++ b/boards/qn9080dk/board.c @@ -61,9 +61,6 @@ mtd_dev_t *mtd0 = (mtd_dev_t *)&mtd_nor_dev; void board_init(void) { /* Initialize LEDs and Buttons. */ - gpio_init(LED_RED_PIN, GPIO_OUT); - gpio_init(LED_GREEN_PIN, GPIO_OUT); - gpio_init(LED_BLUE_PIN, GPIO_OUT); gpio_init(BTN1_PIN, BTN1_MODE); gpio_init(BTN2_PIN, BTN2_MODE); diff --git a/boards/remote-pa/board.c b/boards/remote-pa/board.c index 38f652002f..a6db0ee14c 100644 --- a/boards/remote-pa/board.c +++ b/boards/remote-pa/board.c @@ -28,10 +28,6 @@ static inline void rf_switch_init(void); void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); /* initialize the 2.4GHz RF switch */ diff --git a/boards/remote-reva/board.c b/boards/remote-reva/board.c index 7e35f18389..8bd82bb1f4 100644 --- a/boards/remote-reva/board.c +++ b/boards/remote-reva/board.c @@ -29,7 +29,6 @@ static inline void rf_switch_init(void); void board_init(void) { - /* initialize the boards LEDs */ leds_init(); /* initialize the 2.4GHz RF switch */ rf_switch_init(); @@ -43,10 +42,6 @@ void board_init(void) */ static inline void leds_init(void) { - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - /* Shoot rainbows */ LED_RAINBOW(); } diff --git a/boards/remote-revb/board.c b/boards/remote-revb/board.c index 662cab0c2e..0d8c41c972 100644 --- a/boards/remote-revb/board.c +++ b/boards/remote-revb/board.c @@ -29,7 +29,6 @@ static inline void rf_switch_init(void); void board_init(void) { - /* initialize the boards LEDs */ leds_init(); /* initialize the 2.4GHz RF switch */ rf_switch_init(); @@ -43,9 +42,6 @@ void board_init(void) */ static inline void leds_init(void) { - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); /* Shoot rainbows */ LED_RAINBOW(); diff --git a/boards/rpi-pico/board.c b/boards/rpi-pico/board.c index 007302c692..730c9dd4c2 100644 --- a/boards/rpi-pico/board.c +++ b/boards/rpi-pico/board.c @@ -22,5 +22,4 @@ void board_init(void) { - gpio_init(LED0_PIN, GPIO_OUT); } diff --git a/boards/samd10-xmini/board.c b/boards/samd10-xmini/board.c index 716abc7b86..8cccd775f4 100644 --- a/boards/samd10-xmini/board.c +++ b/boards/samd10-xmini/board.c @@ -23,8 +23,6 @@ void board_init(void) { - /* initialize the on-board LED */ - gpio_init(LED0_PIN, GPIO_OUT); /* initialize the on-board button */ gpio_init(BTN0_PIN, BTN0_MODE); diff --git a/boards/samd20-xpro/board.c b/boards/samd20-xpro/board.c index c2ee17f71a..9c5ee9c8b5 100644 --- a/boards/samd20-xpro/board.c +++ b/boards/samd20-xpro/board.c @@ -23,9 +23,6 @@ void board_init(void) { - /* initialize the on-board LED */ - gpio_init(LED0_PIN, GPIO_OUT); - LED0_OFF; /* initialize the on-board button */ gpio_init(BTN0_PIN, BTN0_MODE); diff --git a/boards/samd21-xpro/board.c b/boards/samd21-xpro/board.c index 990d4fd486..c0d9e9693b 100644 --- a/boards/samd21-xpro/board.c +++ b/boards/samd21-xpro/board.c @@ -26,9 +26,6 @@ void board_init(void) { - /* initialize the on-board LED */ - gpio_init(LED0_PIN, GPIO_OUT); - LED0_OFF; /* initialize the on-board button */ gpio_init(BTN0_PIN, BTN0_MODE); diff --git a/boards/same54-xpro/board.c b/boards/same54-xpro/board.c index 680fdbc02c..0b8597d004 100644 --- a/boards/same54-xpro/board.c +++ b/boards/same54-xpro/board.c @@ -70,11 +70,6 @@ VFS_AUTO_MOUNT(littlefs2, VFS_MTD(same54_nor_dev), "/nvm", 0); void board_init(void) { - /* initialize the on-board LED */ - gpio_init(LED0_PIN, GPIO_OUT); - LED0_OFF; - /* initialize the on-board button */ gpio_init(BTN0_PIN, BTN0_MODE); - } diff --git a/boards/saml21-xpro/board.c b/boards/saml21-xpro/board.c index 10ce3839e6..bcd95d5eed 100644 --- a/boards/saml21-xpro/board.c +++ b/boards/saml21-xpro/board.c @@ -21,25 +21,8 @@ * @} */ -#include - #include "board.h" -#include "cpu.h" -#include "periph/gpio.h" - -void led_init(void); void board_init(void) { - /* initialize the boards LEDs */ - led_init(); -} - -/** - * @brief Initialize the boards on-board LED - */ -void led_init(void) -{ - gpio_init(LED0_PIN, GPIO_OUT); - LED0_OFF; } diff --git a/boards/samr21-xpro/board.c b/boards/samr21-xpro/board.c index 49c20e21d8..b37e5ef73e 100644 --- a/boards/samr21-xpro/board.c +++ b/boards/samr21-xpro/board.c @@ -37,9 +37,6 @@ void board_antenna_config(uint8_t antenna) void board_init(void) { - /* initialize the on-board LED */ - gpio_init(LED0_PIN, GPIO_OUT); - LED0_OFF; /* initialize the on-board antenna switch */ if (IS_USED(MODULE_AT86RF233)) { diff --git a/boards/samr30-xpro/board.c b/boards/samr30-xpro/board.c index 8a9f7036a6..b86c52dc37 100644 --- a/boards/samr30-xpro/board.c +++ b/boards/samr30-xpro/board.c @@ -26,8 +26,6 @@ #include "cpu.h" #include "periph/gpio.h" -void led_init(void); - void board_antenna_config(uint8_t antenna) { if (antenna == RFCTL_ANTENNA_EXT){ @@ -42,23 +40,9 @@ void board_antenna_config(uint8_t antenna) void board_init(void) { - /* initialize the boards LEDs */ - led_init(); - /* initialize the on-board antenna switch */ gpio_init(RFCTL1_PIN, GPIO_OUT); gpio_init(RFCTL2_PIN, GPIO_OUT); /* set default antenna switch configuration */ board_antenna_config(RFCTL_ANTENNA_DEFAULT); } - -/** - * @brief Initialize the boards on-board LED - */ -void led_init(void) -{ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_set(LED0_PIN); /* gpio is inverted => clear */ - gpio_init(LED1_PIN, GPIO_OUT); - gpio_set(LED1_PIN); /* gpio is inverted => clear */ -} diff --git a/boards/samr34-xpro/board.c b/boards/samr34-xpro/board.c index b050c41b7a..fbb6806796 100644 --- a/boards/samr34-xpro/board.c +++ b/boards/samr34-xpro/board.c @@ -29,13 +29,8 @@ #include "sx127x_params.h" #endif -void led_init(void); - void board_init(void) { - /* initialize the boards LEDs */ - led_init(); - /* initialize board specific pins for LoRa */ #ifdef MODULE_SX127X gpio_init(TCXO_PWR_PIN, GPIO_OUT); @@ -44,14 +39,3 @@ void board_init(void) gpio_write(TX_OUTPUT_SEL_PIN, !SX127X_PARAM_PASELECT); #endif /* USEMODULE_SX127X */ } - -/** - * @brief Initialize the boards on-board LED - */ -void led_init(void) -{ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_set(LED0_PIN); /* gpio is inverted => clear */ - gpio_init(LED1_PIN, GPIO_OUT); - gpio_set(LED1_PIN); /* gpio is inverted => clear */ -} diff --git a/boards/seeeduino_arch-pro/board.c b/boards/seeeduino_arch-pro/board.c index 24925e4282..b962a7db4f 100644 --- a/boards/seeeduino_arch-pro/board.c +++ b/boards/seeeduino_arch-pro/board.c @@ -25,26 +25,8 @@ extern void SystemInit(void); -/** - * @brief Initialize the on-board LEDs. - */ -static void leds_init(void) -{ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_init(LED3_PIN, GPIO_OUT); - - LED0_OFF; - LED1_OFF; - LED2_OFF; - LED3_OFF; -} - void board_init(void) { /* initialize core clocks via CMSIS function */ SystemInit(); - /* initialize the boards LEDs */ - leds_init(); } diff --git a/boards/seeeduino_xiao/board.c b/boards/seeeduino_xiao/board.c index afcaeca896..c658defcc7 100644 --- a/boards/seeeduino_xiao/board.c +++ b/boards/seeeduino_xiao/board.c @@ -27,12 +27,5 @@ void board_init(void) { - /* initialize the on-board LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - LED0_OFF; - LED1_OFF; - LED2_OFF; } diff --git a/boards/sensebox_samd21/board.c b/boards/sensebox_samd21/board.c index bcabdfbf15..6fcc85c19a 100644 --- a/boards/sensebox_samd21/board.c +++ b/boards/sensebox_samd21/board.c @@ -44,11 +44,7 @@ mtd_dev_t *mtd0 = (mtd_dev_t *)&sensebox_sd_dev; void board_init(void) { - /* initialize the on-board red LED on pin PA27 */ - gpio_init(LED0_PIN, GPIO_OUT); - /* initialize the on-board green LED on pin PA28 */ - gpio_init(LED1_PIN, GPIO_OUT); /* initialize the on-board button on pin PA20 */ gpio_init(BTN0_PIN, BTN0_MODE); diff --git a/boards/serpente/board.c b/boards/serpente/board.c index d72184937a..4e5aba9750 100644 --- a/boards/serpente/board.c +++ b/boards/serpente/board.c @@ -58,12 +58,5 @@ mtd_dev_t *mtd0 = (mtd_dev_t *)&serpente_nor_dev; void board_init(void) { - /* initialize the on-board red LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - LED0_OFF; - LED1_OFF; - LED2_OFF; } diff --git a/boards/sodaq-one/board.c b/boards/sodaq-one/board.c index 5a729d86dd..1d443c5012 100644 --- a/boards/sodaq-one/board.c +++ b/boards/sodaq-one/board.c @@ -23,13 +23,6 @@ void board_init(void) { - /* initialize the on-board LEDs, switch them off to start with */ - LED0_OFF; - gpio_init(LED0_PIN, GPIO_OUT); - LED1_OFF; - gpio_init(LED1_PIN, GPIO_OUT); - LED2_OFF; - gpio_init(LED2_PIN, GPIO_OUT); /* reset RN2483 (LoRa) */ LORA_RESET_OFF; diff --git a/boards/sodaq-sara-aff/Kconfig b/boards/sodaq-sara-aff/Kconfig index e78b3552e7..d2687832dc 100644 --- a/boards/sodaq-sara-aff/Kconfig +++ b/boards/sodaq-sara-aff/Kconfig @@ -13,4 +13,7 @@ config BOARD_SODAQ_SARA_AFF select BOARD_COMMON_SODAQ select CPU_MODEL_SAMD21J18A +config MODULE_PERIPH_INIT_LED0 + default n if MODULE_PERIPH_SPI + source "$(RIOTBOARD)/common/sodaq/Kconfig" diff --git a/boards/sodaq-sara-aff/Makefile.dep b/boards/sodaq-sara-aff/Makefile.dep index 6674052da6..a8e771c256 100644 --- a/boards/sodaq-sara-aff/Makefile.dep +++ b/boards/sodaq-sara-aff/Makefile.dep @@ -1 +1,6 @@ +ifneq (,$(filter periph_spi,$(USEMODULE))) + # The LED pin is also used for SPI + DISABLE_MODULE += periph_init_led0 +endif + include $(RIOTBOARD)/common/sodaq/Makefile.dep diff --git a/boards/sodaq-sara-aff/board.c b/boards/sodaq-sara-aff/board.c index 2440ef5384..2f8f4d4d07 100644 --- a/boards/sodaq-sara-aff/board.c +++ b/boards/sodaq-sara-aff/board.c @@ -23,20 +23,6 @@ void board_init(void) { - #ifdef AUTO_INIT_LED0 - /* The LED pin is also used for SPI, so we enable it - only if explicitly wanted by the user */ - LED0_OFF; - gpio_init(LED0_PIN, GPIO_OUT); - #endif - - LED_RED_OFF; - gpio_init(LED_RED_PIN, GPIO_OUT); - LED_GREEN_OFF; - gpio_init(LED_GREEN_PIN, GPIO_OUT); - LED_BLUE_OFF; - gpio_init(LED_BLUE_PIN, GPIO_OUT); - /* set NB-IoT device off by default */ NB_IOT_DISABLE; gpio_init(NB_IOT_ENABLE_PIN, GPIO_OUT); @@ -48,5 +34,4 @@ void board_init(void) /* set GPS off by default */ GPS_ENABLE_OFF; gpio_init(GPS_ENABLE_PIN, GPIO_OUT); - } diff --git a/boards/sodaq-sara-sff/board.c b/boards/sodaq-sara-sff/board.c index d71d4ee762..351730c953 100644 --- a/boards/sodaq-sara-sff/board.c +++ b/boards/sodaq-sara-sff/board.c @@ -44,12 +44,9 @@ void board_init(void) /* Initialize the output ports for the LEDs */ LED_RED_OFF; - gpio_init(LED_RED_PIN, GPIO_OUT); LED_BLUE_OFF; - gpio_init(LED_BLUE_PIN, GPIO_OUT); LED_GREEN_OFF; - gpio_init(LED_GREEN_PIN, GPIO_OUT); } diff --git a/boards/spark-core/board.c b/boards/spark-core/board.c index 20bc53245a..a3b7d7061e 100644 --- a/boards/spark-core/board.c +++ b/boards/spark-core/board.c @@ -24,15 +24,6 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_init(LED3_PIN, GPIO_OUT); - gpio_set(LED0_PIN); - gpio_set(LED1_PIN); - gpio_set(LED2_PIN); - gpio_set(LED3_PIN); /* disable systick interrupt, set by the spark bootloader */ SysTick->CTRL = 0; diff --git a/boards/stm32f030f4-demo/board.c b/boards/stm32f030f4-demo/board.c index 6988f9798b..f96bf9551f 100644 --- a/boards/stm32f030f4-demo/board.c +++ b/boards/stm32f030f4-demo/board.c @@ -24,6 +24,4 @@ void board_init(void) { - gpio_init(LED0_PIN, GPIO_OUT); - LED0_OFF; } diff --git a/boards/stm32f0discovery/board.c b/boards/stm32f0discovery/board.c index 098924099a..96fbbf23ff 100644 --- a/boards/stm32f0discovery/board.c +++ b/boards/stm32f0discovery/board.c @@ -23,7 +23,4 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); } diff --git a/boards/stm32f3discovery/board.c b/boards/stm32f3discovery/board.c index 0957d3bc7f..f5cb5510af 100644 --- a/boards/stm32f3discovery/board.c +++ b/boards/stm32f3discovery/board.c @@ -23,13 +23,4 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_init(LED3_PIN, GPIO_OUT); - gpio_init(LED4_PIN, GPIO_OUT); - gpio_init(LED5_PIN, GPIO_OUT); - gpio_init(LED6_PIN, GPIO_OUT); - gpio_init(LED7_PIN, GPIO_OUT); } diff --git a/boards/stm32f429i-disc1/board.c b/boards/stm32f429i-disc1/board.c index 8b3d422382..70fa8580b5 100644 --- a/boards/stm32f429i-disc1/board.c +++ b/boards/stm32f429i-disc1/board.c @@ -23,7 +23,4 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); } diff --git a/boards/stm32f469i-disco/board.c b/boards/stm32f469i-disco/board.c index 029f1322d0..937aa994df 100644 --- a/boards/stm32f469i-disco/board.c +++ b/boards/stm32f469i-disco/board.c @@ -23,8 +23,4 @@ void board_init(void) { - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_init(LED3_PIN, GPIO_OUT); } diff --git a/boards/stm32f4discovery/board.c b/boards/stm32f4discovery/board.c index 3be8cc2f92..32e1ba63b5 100644 --- a/boards/stm32f4discovery/board.c +++ b/boards/stm32f4discovery/board.c @@ -23,9 +23,4 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_init(LED3_PIN, GPIO_OUT); } diff --git a/boards/stm32f723e-disco/Kconfig b/boards/stm32f723e-disco/Kconfig index 5613a145dc..1202848358 100644 --- a/boards/stm32f723e-disco/Kconfig +++ b/boards/stm32f723e-disco/Kconfig @@ -33,4 +33,7 @@ config BOARD_STM32F723E_DISCO # Workaround due to stdout only working with stdin enabled select MODULE_STDIN if TEST_KCONFIG +config MODULE_PERIPH_INIT_LED0 + default n if MODULE_PERIPH_SPI + source "$(RIOTBOARD)/common/stm32/Kconfig" diff --git a/boards/stm32f723e-disco/Makefile.dep b/boards/stm32f723e-disco/Makefile.dep index 5b27928522..e7a10d4824 100644 --- a/boards/stm32f723e-disco/Makefile.dep +++ b/boards/stm32f723e-disco/Makefile.dep @@ -8,5 +8,10 @@ ifneq (,$(filter touch_dev,$(USEMODULE))) USEMODULE += ft5x06 endif +ifneq (,$(filter periph_spi,$(USEMODULE))) + # The LED pin is also used for SPI + DISABLE_MODULE += periph_init_led0 +endif + # TODO: remove the stdin dependency USEMODULE += stdin diff --git a/boards/stm32f723e-disco/board.c b/boards/stm32f723e-disco/board.c index d1cf2a0ef3..7b6a10e665 100644 --- a/boards/stm32f723e-disco/board.c +++ b/boards/stm32f723e-disco/board.c @@ -25,11 +25,4 @@ void board_init(void) { - /* initialize the boards LEDs */ - /* NOTE: LED0 must be explicitly enabled as it is also used for SPI_DEV(0) */ -#ifdef AUTO_INIT_LED0 - gpio_init(LED0_PIN, GPIO_OUT); -#endif - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); } diff --git a/boards/stm32f723e-disco/include/gpio_params.h b/boards/stm32f723e-disco/include/gpio_params.h index e4dfa83799..8756099080 100644 --- a/boards/stm32f723e-disco/include/gpio_params.h +++ b/boards/stm32f723e-disco/include/gpio_params.h @@ -31,7 +31,7 @@ extern "C" { */ static const saul_gpio_params_t saul_gpio_params[] = { -#ifdef AUTO_INIT_LED0 +#ifdef MODULE_PERIPH_INIT_LED0 { .name = "LD1 (blue)", .pin = LED0_PIN, diff --git a/boards/stm32f769i-disco/board.c b/boards/stm32f769i-disco/board.c index cc9025c484..ef70732d0c 100644 --- a/boards/stm32f769i-disco/board.c +++ b/boards/stm32f769i-disco/board.c @@ -25,9 +25,4 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); - gpio_init(LED3_PIN, GPIO_OUT); } diff --git a/boards/stm32g0316-disco/board.c b/boards/stm32g0316-disco/board.c index dd4984c941..b546982f30 100644 --- a/boards/stm32g0316-disco/board.c +++ b/boards/stm32g0316-disco/board.c @@ -24,8 +24,6 @@ void board_init(void) { - gpio_init(LED0_PIN, LED0_MODE); - gpio_set(LED0_PIN); gpio_init(BTN0_PIN, BTN0_MODE); } diff --git a/boards/stm32l0538-disco/board.c b/boards/stm32l0538-disco/board.c index 7f22232974..803386e357 100644 --- a/boards/stm32l0538-disco/board.c +++ b/boards/stm32l0538-disco/board.c @@ -23,7 +23,4 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); } diff --git a/boards/stm32l476g-disco/board.c b/boards/stm32l476g-disco/board.c index 50be4d67a2..b6d406ff12 100644 --- a/boards/stm32l476g-disco/board.c +++ b/boards/stm32l476g-disco/board.c @@ -23,7 +23,4 @@ void board_init(void) { - /* initialize LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); } diff --git a/boards/teensy31/board.c b/boards/teensy31/board.c index 42b9623c29..0c59003a86 100644 --- a/boards/teensy31/board.c +++ b/boards/teensy31/board.c @@ -27,8 +27,5 @@ void board_init(void) { - /* initialize the boards LEDs */ - gpio_init(LED0_PIN, GPIO_OUT); - gpio_set(LED0_PIN); } diff --git a/boards/ublox-c030-u201/board.c b/boards/ublox-c030-u201/board.c index 06392e6cdd..b0aa265417 100644 --- a/boards/ublox-c030-u201/board.c +++ b/boards/ublox-c030-u201/board.c @@ -23,7 +23,4 @@ void board_init(void) { - gpio_init(LED0_PIN, GPIO_OUT); - gpio_init(LED1_PIN, GPIO_OUT); - gpio_init(LED2_PIN, GPIO_OUT); } diff --git a/boards/waspmote-pro/board.c b/boards/waspmote-pro/board.c index 50d6d91cec..a8d065bee5 100644 --- a/boards/waspmote-pro/board.c +++ b/boards/waspmote-pro/board.c @@ -25,24 +25,6 @@ #include "board.h" #include "cpu.h" -/** - * @brief Initialize the boards on-board LEDs (green and red) - * - * The LED initialization is hard-coded in this function. As the LED is soldered - * onto the board it is fixed to its CPU pins. - * - * The LEDs are connected to the following pins: - * - LED_GREEN: PC1 - * - LED_RED: PD6 - */ -void led_init(void) -{ - LED0_ENABLE_PORT; - LED_GREEN_ON; - LED1_ENABLE_PORT; - LED_RED_ON; -} - void board_init(void) { /* initialize UART_1 on AUX1 */ @@ -57,6 +39,4 @@ void board_init(void) SET_MUX_USB_MODULE; #endif #endif - - led_init(); } diff --git a/tests/leds/Makefile b/tests/leds/Makefile index 1db6fdba23..76108073c0 100644 --- a/tests/leds/Makefile +++ b/tests/leds/Makefile @@ -1,6 +1,6 @@ include ../Makefile.tests_common # Some boards do not initialize LED0 by default -CFLAGS=-DAUTO_INIT_LED0 +CFLAGS=-DPERIPH_INIT_LED0 include $(RIOTBASE)/Makefile.include