diff --git a/boards/Kconfig b/boards/Kconfig index 32f0681809..d0ab91e534 100644 --- a/boards/Kconfig +++ b/boards/Kconfig @@ -203,7 +203,6 @@ config ARCH_BOARD_ESP32_DEVKITC config ARCH_BOARD_ESP32_ETHERNETKIT bool "Espressif ESP32 Ethernet Kit" depends on ARCH_CHIP_ESP32 - select ARCH_HAVE_LEDS ---help--- The ESP32-Ethernet-Kit is an Ethernet-to-Wi-Fi development board that enables Ethernet devices to be interconnected over Wi-Fi. At the same time, to provide diff --git a/boards/xtensa/esp32/esp32-devkitc/include/board.h b/boards/xtensa/esp32/esp32-devkitc/include/board.h index bcb8000cac..29a025ab13 100644 --- a/boards/xtensa/esp32/esp32-devkitc/include/board.h +++ b/boards/xtensa/esp32/esp32-devkitc/include/board.h @@ -90,6 +90,5 @@ /* Define how many LEDs this board has (needed by userleds) */ #define BOARD_NLEDS 1 -#define GPIO_LED1 2 #endif /* __BOARDS_XTENSA_ESP32_ESP32_CORE_INCLUDE_BOARD_H */ diff --git a/boards/xtensa/esp32/esp32-devkitc/src/esp32-devkitc.h b/boards/xtensa/esp32/esp32-devkitc/src/esp32-devkitc.h index 751ed824c7..c69185f677 100644 --- a/boards/xtensa/esp32/esp32-devkitc/src/esp32-devkitc.h +++ b/boards/xtensa/esp32/esp32-devkitc/src/esp32-devkitc.h @@ -48,6 +48,15 @@ * Pre-processor Definitions ****************************************************************************/ +/* GPIO Pin Definitions *****************************************************/ + +/* LED + * + * This is an externally connected LED used for testing. + */ + +#define GPIO_LED1 2 + /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c b/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c index 09dcbd10c1..c439747217 100644 --- a/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c +++ b/boards/xtensa/esp32/esp32-devkitc/src/esp32_userleds.c @@ -27,9 +27,11 @@ #include #include #include -#include -#include "esp32_gpio.h" +#include +#include + +#include "esp32_gpio.h" #include "esp32-devkitc.h" /**************************************************************************** diff --git a/boards/xtensa/esp32/esp32-ethernet-kit/include/board.h b/boards/xtensa/esp32/esp32-ethernet-kit/include/board.h index aa1ec9109d..db86bf3e09 100644 --- a/boards/xtensa/esp32/esp32-ethernet-kit/include/board.h +++ b/boards/xtensa/esp32/esp32-ethernet-kit/include/board.h @@ -72,11 +72,4 @@ #endif #endif -/* LED definitions **********************************************************/ - -/* Define how many LEDs this board has (needed by userleds) */ - -#define BOARD_NLEDS 1 -#define GPIO_LED1 2 - #endif /* __BOARDS_XTENSA_ESP32_ESP32_ETHERNET_KIT_INCLUDE_BOARD_H */ diff --git a/boards/xtensa/esp32/esp32-ethernet-kit/src/Make.defs b/boards/xtensa/esp32/esp32-ethernet-kit/src/Make.defs index fdced63808..d51463d06d 100644 --- a/boards/xtensa/esp32/esp32-ethernet-kit/src/Make.defs +++ b/boards/xtensa/esp32/esp32-ethernet-kit/src/Make.defs @@ -45,10 +45,6 @@ ifeq ($(CONFIG_ESP32_SPIFLASH),y) CSRCS += esp32_spiflash.c endif -ifeq ($(CONFIG_USERLED),y) -CSRCS += esp32_userleds.c -endif - SCRIPTIN = $(SCRIPTDIR)$(DELIM)esp32.template.ld SCRIPTOUT = $(SCRIPTDIR)$(DELIM)esp32_out.ld diff --git a/boards/xtensa/esp32/esp32-ethernet-kit/src/esp32_userleds.c b/boards/xtensa/esp32/esp32-ethernet-kit/src/esp32_userleds.c deleted file mode 100644 index 45fc66bdb6..0000000000 --- a/boards/xtensa/esp32/esp32-ethernet-kit/src/esp32_userleds.c +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** - * boards/xtensa/esp32/esp32-ethernet-kit/src/esp32_userleds.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include -#include -#include "esp32_gpio.h" - -#include "esp32-ethernet-kit.h" - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/* This array maps an LED number to GPIO pin configuration */ - -static const uint32_t g_ledcfg[BOARD_NLEDS] = -{ - GPIO_LED1, -}; - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: board_userled_initialize - ****************************************************************************/ - -uint32_t board_userled_initialize(void) -{ - uint8_t i; - - for (i = 0; i < BOARD_NLEDS; i++) - { - esp32_configgpio(g_ledcfg[i], OUTPUT); - } - - return BOARD_NLEDS; -} - -/**************************************************************************** - * Name: board_userled - ****************************************************************************/ - -void board_userled(int led, bool ledon) -{ - if ((unsigned)led < BOARD_NLEDS) - { - esp32_gpiowrite(g_ledcfg[led], ledon); - } -} - -/**************************************************************************** - * Name: board_userled_all - ****************************************************************************/ - -void board_userled_all(uint32_t ledset) -{ - uint8_t i; - - /* Configure LED1-8 GPIOs for output */ - - for (i = 0; i < BOARD_NLEDS; i++) - { - esp32_gpiowrite(g_ledcfg[i], (ledset & (1 << i)) != 0); - } -} -