Skip to content

Commit

Permalink
Merge #19432 #19461
Browse files Browse the repository at this point in the history
19432: boards/esp32: deduplication in common ESP32x board definitions r=benpicco a=gschorcht

### Contribution description

The PR reduced code duplication in `boards/common/esp32*`.

The PR moves the header files from `boards/common/esp32s3/include` that can be used for all types of ESP32x SoCs to a new common ESP32x board definition which is then included by all common ESP32x board definitions.

### Testing procedure

Green CI.

### Issues/PRs references


19461: drivers/enc28j60: fix ISR routine and bth r=benpicco a=peteut



Co-authored-by: Gunar Schorcht <[email protected]>
Co-authored-by: Alain Péteut <[email protected]>
  • Loading branch information
3 people authored Apr 12, 2023
3 parents b342cdc + 128a633 + 226b8cf commit 99b13cb
Show file tree
Hide file tree
Showing 49 changed files with 408 additions and 2,179 deletions.
6 changes: 3 additions & 3 deletions boards/common/esp32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

config BOARD_COMMON_ESP32
bool
select HAS_PERIPH_UART

select HAVE_SAUL_GPIO
select BOARD_COMMON_ESP32X

config MODULE_BOARDS_COMMON_ESP32
bool
Expand All @@ -18,3 +16,5 @@ config MODULE_BOARDS_COMMON_ESP32
default y
help
Common ESP32 boards code.

source "$(RIOTBOARD)/common/esp32x/Kconfig"
2 changes: 2 additions & 0 deletions boards/common/esp32/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
MODULE = boards_common_esp32

DIRS = $(RIOTBOARD)/common/esp32x

include $(RIOTBASE)/Makefile.base
4 changes: 1 addition & 3 deletions boards/common/esp32/Makefile.dep
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
USEMODULE += boards_common_esp32

ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio
endif
include $(RIOTBOARD)/common/esp32x/Makefile.dep
4 changes: 1 addition & 3 deletions boards/common/esp32/Makefile.features
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
CPU = esp32
CPU_FAM = esp32

# additional features provided by all boards is at least one UART
FEATURES_PROVIDED += periph_uart
include $(RIOTBOARD)/common/esp32x/Makefile.features
6 changes: 3 additions & 3 deletions boards/common/esp32/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# configure the serial interface
PORT_LINUX ?= /dev/ttyUSB0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
INCLUDES += -I$(RIOTBOARD)/common/esp32/include

include $(RIOTBOARD)/common/esp32x/Makefile.include
3 changes: 1 addition & 2 deletions boards/common/esp32/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
/**
* @defgroup boards_esp32 ESP32 Boards
* @ingroup boards
* @brief This group of boards contains the documentation
* defined ESP32 boards.
* @brief This group of boards contains the documentation of ESP32 boards.
*
* @note For detailed information about the ESP32 SoC, the tool chain
* as well as configuring and compiling RIOT for ESP32 boards,
Expand Down
72 changes: 0 additions & 72 deletions boards/common/esp32/include/arduino_board_common.h

This file was deleted.

168 changes: 0 additions & 168 deletions boards/common/esp32/include/board_common.h

This file was deleted.

52 changes: 52 additions & 0 deletions boards/common/esp32/include/board_common_esp32.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Copyright (C) 2018 Gunar Schorcht
*
* 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_esp32
* @brief Board definitions that are common for all ESP32 boards.
*
* This file contains board configurations that are valid for all ESP32.
*
* For detailed information about the configuration of ESP32 boards, see
* section \ref esp32_peripherals "Common Peripherals".
*
* @author Gunar Schorcht <[email protected]>
* @file
* @{
*/

#ifndef BOARD_COMMON_ESP32_H
#define BOARD_COMMON_ESP32_H

#include "board_common.h"

/**
* @brief External clock crystal frequency (MHz)
*
* Most boards use a 40MHz crystal, including all those based on Espressif's
* WROOM-32 and WROVER-32 modules. Those that don't, like the SparkFun ESP32
* Thing (26MHz), must define ESP32_XTAL_FREQ appropriately in their board
* configuration.
*
* An obvious side effect of a mismatch is that the UART won't sync and the
* development terminal will show garbage instead of log output.
*/
#ifndef ESP32_XTAL_FREQ
#define ESP32_XTAL_FREQ (40)
#endif

#ifdef __cplusplus
extern "C" {
#endif

#ifdef __cplusplus
} /* end extern "C" */
#endif

#endif /* BOARD_COMMON_ESP32_H */
/** @} */
Loading

0 comments on commit 99b13cb

Please sign in to comment.