From 7821329851f69b6b945f061bc4d15212d43c3198 Mon Sep 17 00:00:00 2001 From: mikecarper Date: Mon, 5 Oct 2026 11:56:00 -0700 Subject: [PATCH] Keep OTA headers aligned with the checked-out vendored source --- arch/esp32/AsyncElegantOTA/src/AsyncElegantOTA.cpp | 2 +- examples/esp32_partition_legacy_seed/main.cpp | 2 +- examples/esp32_partition_migrator/main.cpp | 2 +- scripts/esp32_async_web_fix.py | 10 ++++++++-- src/helpers/ESP32Board.cpp | 2 +- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/esp32/AsyncElegantOTA/src/AsyncElegantOTA.cpp b/arch/esp32/AsyncElegantOTA/src/AsyncElegantOTA.cpp index 65d3542b..da49472a 100644 --- a/arch/esp32/AsyncElegantOTA/src/AsyncElegantOTA.cpp +++ b/arch/esp32/AsyncElegantOTA/src/AsyncElegantOTA.cpp @@ -1,4 +1,4 @@ -#include +#include "AsyncElegantOTA.h" #include static std::atomic ota_uploads_enabled{false}; static std::atomic ota_upload_busy{false}; diff --git a/examples/esp32_partition_legacy_seed/main.cpp b/examples/esp32_partition_legacy_seed/main.cpp index b7915d30..9b42532e 100644 --- a/examples/esp32_partition_legacy_seed/main.cpp +++ b/examples/esp32_partition_legacy_seed/main.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include "../../arch/esp32/AsyncElegantOTA/src/AsyncElegantOTA.h" #include #include diff --git a/examples/esp32_partition_migrator/main.cpp b/examples/esp32_partition_migrator/main.cpp index 43934e0e..fb9fc358 100644 --- a/examples/esp32_partition_migrator/main.cpp +++ b/examples/esp32_partition_migrator/main.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include "../../arch/esp32/AsyncElegantOTA/src/AsyncElegantOTA.h" #include #include #include diff --git a/scripts/esp32_async_web_fix.py b/scripts/esp32_async_web_fix.py index b9a0c4dc..992a7d9e 100644 --- a/scripts/esp32_async_web_fix.py +++ b/scripts/esp32_async_web_fix.py @@ -35,6 +35,14 @@ def replace_async_source(build_env, node): return node destination = Path(build_env.subst("$BUILD_DIR")) / "patched-esp32-web" / source.name destination.parent.mkdir(parents=True, exist_ok=True) + if source.name == "AsyncElegantOTA.cpp": + # Quoted includes resolve beside this private source, ahead of any + # stale library include path inherited by PlatformIO's build clone. + for name in ("AsyncElegantOTA.h", "Hash.h", "elegantWebpage.h"): + header = (include_dir / name).read_bytes() + target = destination.parent / name + if not target.exists() or target.read_bytes() != header: + target.write_bytes(header) if not destination.exists() or destination.read_text(encoding="ascii") != content: destination.write_text(content, encoding="ascii") build_env.PrependUnique(CPPPATH=[str(include_dir)]) @@ -42,8 +50,6 @@ def replace_async_source(build_env, node): def install(build_env): - build_env.PrependUnique(CPPPATH=[str(Path(build_env.subst("$PROJECT_DIR")) - / "arch/esp32/AsyncElegantOTA/src")]) build_env.AddBuildMiddleware(replace_async_source, "*AsyncTCP*src*AsyncTCP.cpp") build_env.AddBuildMiddleware(replace_async_source, "*AsyncElegantOTA*src*AsyncElegantOTA.cpp") diff --git a/src/helpers/ESP32Board.cpp b/src/helpers/ESP32Board.cpp index 604fd3d3..11b406e8 100644 --- a/src/helpers/ESP32Board.cpp +++ b/src/helpers/ESP32Board.cpp @@ -365,7 +365,7 @@ bool ESP32Board::stopOTAUpdate(char reply[]) { #include #include #include -#include +#include "../../arch/esp32/AsyncElegantOTA/src/AsyncElegantOTA.h" #include #include