Merge branch 'esp8266-native-toolchain-plumbing' into esp8266-native-build-infra

This commit is contained in:
J. Nick Koston
2026-08-21 20:27:43 -05:00
2 changed files with 13 additions and 6 deletions
+10 -6
View File
@@ -593,12 +593,16 @@ async def _add_platformio_options(pio_options: dict[str, str | list[str]]) -> No
# platformio/library.py); filters top-level libraries and
# discovered dependencies
cg.add_platformio_option(key, vals)
elif key == "board_build.f_cpu" and CORE.using_toolchain_arduino:
# A real-world overclock knob (many published ESP8266 configs
# pin 160000000L for timing-sensitive integrations); the
# esp8266 native generator reads it for -DF_CPU. Other native
# toolchains have no equivalent and fall through to the
# warning.
elif (
key in ("board_build.f_cpu", "board_build.ldscript")
and CORE.using_toolchain_arduino
):
# Real-world knobs many published ESP8266 configs rely on:
# f_cpu 160000000L for timing-sensitive integrations, and a
# custom ldscript to reserve a filesystem region or correct
# a board's flash size. The esp8266 native generator reads
# both; other native toolchains have no equivalent and fall
# through to the warning.
cg.add_platformio_option(key, val)
elif key != "upload_speed":
# upload_speed needs no handling: it is read from the raw
+3
View File
@@ -1408,13 +1408,16 @@ async def test_add_platformio_options_native_arduino(
await config._add_platformio_options(
{
"board_build.f_cpu": "160000000L",
"board_build.ldscript": "eagle.flash.4m2m.ld",
"board_build.filesystem": "littlefs",
"upload_speed": "115200",
}
)
assert CORE.platformio_options["board_build.f_cpu"] == "160000000L"
assert CORE.platformio_options["board_build.ldscript"] == "eagle.flash.4m2m.ld"
assert "board_build.f_cpu is ignored" not in caplog.text
assert "board_build.ldscript is ignored" not in caplog.text
assert (
"esphome->platformio_options->board_build.filesystem is ignored" in caplog.text
)