From 45845acf6d1cba5705f11abd08d8491bcc35c0a5 Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Tue, 15 Aug 2023 23:12:57 +1000 Subject: [PATCH] rp2: Use uppercase variant names. This is to support a future change to add the variant name to the build directory and therefore should be the same style as the board name. This only affects the WEACTSTUDIO board. Also standardises on a convention for naming flash-size variants. Normally we would write e.g. 2MiB, but in uppercase, it's awkward to write 2MIB, so instead use 2M, 512K, etc for variant names, but use 2MiB when not constrained by case (e.g. a regular filename). This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared --- ports/rp2/boards/WEACTSTUDIO/README.md | 11 ++++------- ports/rp2/boards/WEACTSTUDIO/board.json | 6 +++--- ports/rp2/boards/WEACTSTUDIO/mpconfigboard.cmake | 14 +++++++------- .../{weactstudio_16mb.h => weactstudio_16MiB.h} | 0 .../{weactstudio_2mb.h => weactstudio_2MiB.h} | 0 .../{weactstudio_4mb.h => weactstudio_4MiB.h} | 0 .../{weactstudio_8mb.h => weactstudio_8MiB.h} | 0 7 files changed, 14 insertions(+), 17 deletions(-) rename ports/rp2/boards/WEACTSTUDIO/{weactstudio_16mb.h => weactstudio_16MiB.h} (100%) rename ports/rp2/boards/WEACTSTUDIO/{weactstudio_2mb.h => weactstudio_2MiB.h} (100%) rename ports/rp2/boards/WEACTSTUDIO/{weactstudio_4mb.h => weactstudio_4MiB.h} (100%) rename ports/rp2/boards/WEACTSTUDIO/{weactstudio_8mb.h => weactstudio_8MiB.h} (100%) diff --git a/ports/rp2/boards/WEACTSTUDIO/README.md b/ports/rp2/boards/WEACTSTUDIO/README.md index ae0acfd2c7..1d55350900 100644 --- a/ports/rp2/boards/WEACTSTUDIO/README.md +++ b/ports/rp2/boards/WEACTSTUDIO/README.md @@ -9,18 +9,15 @@ repository containing information on the board. ## Build notes -Builds can be configured with the `BOARD_VARIANT` parameter. Valid variants -can be displayed with the `query-variant` target. An example: +By default the firmware supports boards with 16MiB flash. This can be +configured using the `BOARD_VARIANT` parameter. The valid options are +`FLASH_2M`, 'FLASH_4M', and 'FLASH_8M'. ```bash > cd ports/rp2 -> make BOARD=WEACTSTUDIO query-variants -VARIANTS: flash_2mb flash_4mb flash_8mb flash_16mb -> make BOARD=WEACTSTUDIO BOARD_VARIANT=flash_8mb submodules all # Build the 8 MiB variant +> make BOARD=WEACTSTUDIO BOARD_VARIANT=FLASH_8M submodules all # Build the 8 MiB variant ``` -`flash_16mb` is the default if `BOARD_VARIANT` is not supplied. - ## Board-specific modules The `board` module contains definitions for the onboard LED and user button. diff --git a/ports/rp2/boards/WEACTSTUDIO/board.json b/ports/rp2/boards/WEACTSTUDIO/board.json index 3a3f2f741f..223bbdc07b 100644 --- a/ports/rp2/boards/WEACTSTUDIO/board.json +++ b/ports/rp2/boards/WEACTSTUDIO/board.json @@ -15,9 +15,9 @@ "product": "WeAct Studio RP2040", "url": "https://github.com/WeActTC/WeActStudio.RP2040CoreBoard", "variants": { - "flash_2mb": "2 MiB Flash", - "flash_4mb": "4 MiB Flash", - "flash_8mb": "8 MiB Flash" + "FLASH_2MB": "2 MiB Flash", + "FLASH_4MB": "4 MiB Flash", + "FLASH_8MB": "8 MiB Flash" }, "vendor": "WeAct" } diff --git a/ports/rp2/boards/WEACTSTUDIO/mpconfigboard.cmake b/ports/rp2/boards/WEACTSTUDIO/mpconfigboard.cmake index 28a30f4580..848b50f604 100644 --- a/ports/rp2/boards/WEACTSTUDIO/mpconfigboard.cmake +++ b/ports/rp2/boards/WEACTSTUDIO/mpconfigboard.cmake @@ -8,17 +8,17 @@ list(APPEND PICO_BOARD_HEADER_DIRS ${MICROPY_BOARD_DIR}) set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py) # Select the 16MB variant as the default -set(PICO_BOARD "weactstudio_16mb") +set(PICO_BOARD "weactstudio_16MiB") # Provide different variants for the downloads page -if(MICROPY_BOARD_VARIANT STREQUAL "flash_2mb") - set(PICO_BOARD "weactstudio_2mb") +if(MICROPY_BOARD_VARIANT STREQUAL "FLASH_2M") + set(PICO_BOARD "weactstudio_2MiB") endif() -if(MICROPY_BOARD_VARIANT STREQUAL "flash_4mb") - set(PICO_BOARD "weactstudio_4mb") +if(MICROPY_BOARD_VARIANT STREQUAL "FLASH_4M") + set(PICO_BOARD "weactstudio_4MiB") endif() -if(MICROPY_BOARD_VARIANT STREQUAL "flash_8mb") - set(PICO_BOARD "weactstudio_8mb") +if(MICROPY_BOARD_VARIANT STREQUAL "FLASH_8M") + set(PICO_BOARD "weactstudio_8MiB") endif() diff --git a/ports/rp2/boards/WEACTSTUDIO/weactstudio_16mb.h b/ports/rp2/boards/WEACTSTUDIO/weactstudio_16MiB.h similarity index 100% rename from ports/rp2/boards/WEACTSTUDIO/weactstudio_16mb.h rename to ports/rp2/boards/WEACTSTUDIO/weactstudio_16MiB.h diff --git a/ports/rp2/boards/WEACTSTUDIO/weactstudio_2mb.h b/ports/rp2/boards/WEACTSTUDIO/weactstudio_2MiB.h similarity index 100% rename from ports/rp2/boards/WEACTSTUDIO/weactstudio_2mb.h rename to ports/rp2/boards/WEACTSTUDIO/weactstudio_2MiB.h diff --git a/ports/rp2/boards/WEACTSTUDIO/weactstudio_4mb.h b/ports/rp2/boards/WEACTSTUDIO/weactstudio_4MiB.h similarity index 100% rename from ports/rp2/boards/WEACTSTUDIO/weactstudio_4mb.h rename to ports/rp2/boards/WEACTSTUDIO/weactstudio_4MiB.h diff --git a/ports/rp2/boards/WEACTSTUDIO/weactstudio_8mb.h b/ports/rp2/boards/WEACTSTUDIO/weactstudio_8MiB.h similarity index 100% rename from ports/rp2/boards/WEACTSTUDIO/weactstudio_8mb.h rename to ports/rp2/boards/WEACTSTUDIO/weactstudio_8MiB.h