Browse Source

rp2: Rework board variant support to require mpconfigvariant file.

Following how the board variants now work in the esp32 port.

Signed-off-by: Damien George <damien@micropython.org>
pull/15336/head
Damien George 5 months ago
parent
commit
5dff78f38e
  1. 12
      ports/rp2/CMakeLists.txt
  2. 16
      ports/rp2/boards/WEACTSTUDIO/mpconfigboard.cmake
  3. 1
      ports/rp2/boards/WEACTSTUDIO/mpconfigvariant.cmake
  4. 1
      ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_2M.cmake
  5. 1
      ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_4M.cmake
  6. 1
      ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_8M.cmake

12
ports/rp2/CMakeLists.txt

@ -38,10 +38,22 @@ if(NOT EXISTS ${MICROPY_BOARD_DIR}/mpconfigboard.cmake)
message(FATAL_ERROR "Invalid MICROPY_BOARD specified: ${MICROPY_BOARD}")
endif()
# If a board variant is specified, check that it exists.
if(MICROPY_BOARD_VARIANT)
if(NOT EXISTS ${MICROPY_BOARD_DIR}/mpconfigvariant_${MICROPY_BOARD_VARIANT}.cmake)
message(FATAL_ERROR "Invalid MICROPY_BOARD_VARIANT specified: ${MICROPY_BOARD_VARIANT}")
endif()
endif()
set(MICROPY_USER_FROZEN_MANIFEST ${MICROPY_FROZEN_MANIFEST})
# Include board config, it may override MICROPY_FROZEN_MANIFEST
include(${MICROPY_BOARD_DIR}/mpconfigboard.cmake)
if(NOT MICROPY_BOARD_VARIANT)
include(${MICROPY_BOARD_DIR}/mpconfigvariant.cmake OPTIONAL)
else()
include(${MICROPY_BOARD_DIR}/mpconfigvariant_${MICROPY_BOARD_VARIANT}.cmake)
endif()
# Set the PICO_BOARD if it's not already set (allow a board to override it).
if(NOT PICO_BOARD)

16
ports/rp2/boards/WEACTSTUDIO/mpconfigboard.cmake

@ -6,19 +6,3 @@ list(APPEND PICO_BOARD_HEADER_DIRS ${MICROPY_BOARD_DIR})
# Freeze board.py
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)
# Select the 16MB variant as the default
set(PICO_BOARD "weactstudio_16MiB")
# Provide different variants for the downloads page
if(MICROPY_BOARD_VARIANT STREQUAL "FLASH_2M")
set(PICO_BOARD "weactstudio_2MiB")
endif()
if(MICROPY_BOARD_VARIANT STREQUAL "FLASH_4M")
set(PICO_BOARD "weactstudio_4MiB")
endif()
if(MICROPY_BOARD_VARIANT STREQUAL "FLASH_8M")
set(PICO_BOARD "weactstudio_8MiB")
endif()

1
ports/rp2/boards/WEACTSTUDIO/mpconfigvariant.cmake

@ -0,0 +1 @@
set(PICO_BOARD "weactstudio_16MiB")

1
ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_2M.cmake

@ -0,0 +1 @@
set(PICO_BOARD "weactstudio_2MiB")

1
ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_4M.cmake

@ -0,0 +1 @@
set(PICO_BOARD "weactstudio_4MiB")

1
ports/rp2/boards/WEACTSTUDIO/mpconfigvariant_FLASH_8M.cmake

@ -0,0 +1 @@
set(PICO_BOARD "weactstudio_8MiB")
Loading…
Cancel
Save