lv_micropython/ports/esp32/boards/ESP32_GENERIC/mpconfigvariant_D2WD.cmake
Damien George 43ebbec0c5 esp32: Rework board variant support to require mpconfigvariant file.
This commit reworks board variants on the esp32 port.  It's a simple change
that moves the board variant configuration from an "if" statement within
`mpconfigboard.cmake` into separate files for each variant, with the name
of the variant encoded in the filename: `mpconfigvariant_VARIANT.cmake`.

Optionally, the base variant can have its own options in
`mpconfigvariant.cmake` (this is an optional file, but all other variants
of the base must have a corresponding mpconfigvariant file).

There are two benefits to this:
- The build system now gives an error if the variant that you specified
  doesn't exist (because the mpconfigvariant file must exist with the
  variant name you specify).
- No more error-prone if-logic needed in the .cmake files.

The way to build a variant is unchanged, still via:

    $ make BOARD_VARIANT=VARIANT

Signed-off-by: Damien George <damien@micropython.org>
2024-06-28 11:23:55 +10:00

12 lines
274 B
CMake

set(SDKCONFIG_DEFAULTS
${SDKCONFIG_DEFAULTS}
boards/ESP32_GENERIC/sdkconfig.d2wd
)
list(APPEND MICROPY_DEF_BOARD
MICROPY_HW_MCU_NAME="ESP32-D2WD"
# Disable some options to reduce firmware size.
MICROPY_OPT_COMPUTED_GOTO=0
MICROPY_PY_NETWORK_LAN=0
)