Skip to content

Commit ffe4d36

Browse files
add Chip variant to pioarduino-build.py (#12037)
* add `chip_variant` to pioarduino-build.py to support different variants of an MCU (p4 prev3 and postv3) * Refactor build_mcu and chip_variant assignment logic * ci(pre-commit): Apply automatic fixes * Fix chip_variant retrieval with default value --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent 0c042bd commit ffe4d36

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/pioarduino-build.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
platform = env.PioPlatform()
3333
board_config = env.BoardConfig()
3434
build_mcu = board_config.get("build.mcu", "").lower()
35+
chip_variant = board_config.get("build.chip_variant", "").lower()
36+
chip_variant = chip_variant if chip_variant else build_mcu
3537
partitions_name = board_config.get("build.partitions", board_config.get("build.arduino.partitions", ""))
3638

3739
FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32")
@@ -80,7 +82,7 @@ def get_bootloader_image(variants_dir):
8082
else generate_bootloader_image(
8183
join(
8284
FRAMEWORK_LIBS_DIR,
83-
build_mcu,
85+
chip_variant,
8486
"bin",
8587
"bootloader_${__get_board_boot_mode(__env__)}_${__get_board_f_boot(__env__)}.elf",
8688
)
@@ -159,7 +161,7 @@ def add_tinyuf2_extra_image():
159161
SConscript(
160162
join(
161163
FRAMEWORK_LIBS_DIR,
162-
build_mcu,
164+
chip_variant,
163165
"pioarduino-build.py",
164166
)
165167
)

0 commit comments

Comments
 (0)