Hosted update

This commit is contained in:
iranl
2025-11-05 21:50:09 +01:00
parent 49dd69bc7b
commit 27e9ac2085
16 changed files with 553 additions and 135 deletions

29
apply_patches.py Normal file
View File

@@ -0,0 +1,29 @@
from os.path import join, isfile
Import("env")
FRAMEWORK_DIR = env.PioPlatform().get_package_dir("framework-arduinoespressif32")
patchflag_path = join(FRAMEWORK_DIR, ".hosted-patching-done")
# patch file only if we didn't do it before
if not isfile(join(FRAMEWORK_DIR, ".hosted-patching-done")):
original_file = join(FRAMEWORK_DIR, "cores", "esp32", "esp32-hal-hosted.c")
patched_file = join("resources", "esp32-hal-hosted.c.patch")
assert isfile(original_file) and isfile(patched_file)
env.Execute("patch %s %s" % (original_file, patched_file))
# env.Execute("touch " + patchflag_path)
original_file = join(FRAMEWORK_DIR, "cores", "esp32", "esp32-hal-hosted.h")
patched_file = join("resources", "esp32-hal-hosted.h.patch")
assert isfile(original_file) and isfile(patched_file)
env.Execute("patch %s %s" % (original_file, patched_file))
def _touch(path):
with open(path, "w") as fp:
fp.write("")
env.Execute(lambda *args, **kwargs: _touch(patchflag_path))