diff --git a/code/platformio.ini b/code/platformio.ini index 86a72e1f..95242229 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -152,7 +152,7 @@ lib_deps = https://github.com/mcleng/MAX6675-Library#2.0.1 https://github.com/ThingPulse/esp8266-oled-ssd1306#3398c97 Adafruit SI1145 Library@~1.1.1 - https://github.com/BoschSensortec/BSEC-Arduino-library.git#c5503e0 + https://github.com/BoschSensortec/BSEC-Arduino-library.git#v1.6.1480 adafruit/Adafruit NeoPixel@^1.7.0 # ------------------------------------------------------------------------------ diff --git a/code/scripts/espurna_utils/__init__.py b/code/scripts/espurna_utils/__init__.py index 8906ad17..9b128d62 100644 --- a/code/scripts/espurna_utils/__init__.py +++ b/code/scripts/espurna_utils/__init__.py @@ -22,7 +22,6 @@ from .checks import check_cppcheck, check_printsize from .float_support import remove_float_support from .ldscripts import ldscripts_inject_libpath -from .libalgobsec import libalgobsec_inject_patcher from .postmortem import dummy_ets_printf from .git import app_inject_revision from .release import copy_release @@ -33,7 +32,6 @@ __all__ = [ "check_printsize", "remove_float_support", "ldscripts_inject_libpath", - "libalgobsec_inject_patcher", "dummy_ets_printf", "app_inject_revision", "app_inject_flags", diff --git a/code/scripts/espurna_utils/libalgobsec.py b/code/scripts/espurna_utils/libalgobsec.py deleted file mode 100644 index 9b1cbf25..00000000 --- a/code/scripts/espurna_utils/libalgobsec.py +++ /dev/null @@ -1,69 +0,0 @@ -import os -import sys - - -def libalgobsec_inject_patcher(env): - libalgobsec_builder = next( - ( - builder - for builder in env.GetLibBuilders() - if builder.name == "BSEC Software Library" - ), - None, - ) - - if libalgobsec_builder is None: - return - - def process_archive(target, source, env): - import subprocess - - # Allows `import espurna_utils` for external scripts, where we might not be within scons runtime - from SCons.Script import Delete, Mkdir - - tmpdir = env.get( - "ESPURNA_LIBALGOBSEC_PATCHER_TMPDIR", - os.path.join(str(target[0].get_dir()), "_tmpdir"), - ) - - env.Execute(Mkdir(tmpdir)) - - # XXX: $AR does not support output argument for the extraction - # always switch into tmpdir when running commands - def run(cmd): - sys.stdout.write(" ".join(cmd)) - sys.stdout.write("\n") - subprocess.check_call(cmd, cwd=tmpdir) - - run([env.subst("$AR"), "x", source[0].abspath]) - - names = [] - for infilename in os.listdir(tmpdir): - newname = infilename - if not infilename.endswith(".c.o"): - newname = infilename.replace(".o", ".c.o") - os.rename(os.path.join(tmpdir, infilename), os.path.join(tmpdir, newname)) - names.append(newname) - - pack_cmd = [env.subst("$AR"), "cr", target[0].abspath] - pack_cmd.extend(names) - run(pack_cmd) - - env.Execute(Delete(tmpdir)) - - # Instead of replacing the file in-place, link with the patched version - libalgobsec_dir = os.path.join(libalgobsec_builder.src_dir, "esp8266") - - target = env.File( - "libalgobsec.a", directory=env.subst("$BUILD_DIR/libalgobsec_patched") - ) - source = env.File("libalgobsec.a", directory=libalgobsec_dir) - - command = env.Command(target, source, process_archive) - patcher = env.Alias("patch-libalgobsec", command) - - env.Append(LIBPATH=[target.get_dir()]) - env.Append(LIBS=["algobsec"]) - - env.Depends("$BUILD_DIR/${PROGNAME}.elf", patcher) - diff --git a/code/scripts/pio_main.py b/code/scripts/pio_main.py index 92315120..aee153bc 100644 --- a/code/scripts/pio_main.py +++ b/code/scripts/pio_main.py @@ -13,7 +13,6 @@ from espurna_utils import ( check_printsize, remove_float_support, ldscripts_inject_libpath, - libalgobsec_inject_patcher, app_inject_revision, dummy_ets_printf, app_inject_flags, @@ -45,9 +44,6 @@ if "DISABLE_POSTMORTEM_STACKDUMP" in env["CPPFLAGS"]: "$BUILD_DIR/FrameworkArduino/core_esp8266_postmortem.cpp.o", dummy_ets_printf ) -# place bsec's libalgobsec.a sections in the flash to avoid "section ‘.text' will not fit in region 'iram1_0_seg'" error -libalgobsec_inject_patcher(env) - # when using git, add -DAPP_REVISION=(git-commit-hash) app_inject_revision(projenv)