Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.2 KiB

  1. # Run this script every time building an env:
  2. from espurna_utils import (
  3. check_printsize,
  4. remove_float_support,
  5. ldscripts_inject_libpath,
  6. lwip_inject_patcher,
  7. app_inject_revision,
  8. dummy_ets_printf
  9. )
  10. Import("env", "projenv")
  11. # Always show warnings for project code
  12. projenv.ProcessUnFlags("-w")
  13. # XXX: note that this will also break %d format with floats and print raw memory contents as int
  14. # Cores after 2.3.0 can disable %f in the printf / scanf to reduce .bin size
  15. remove_float_support(env)
  16. ldscripts_inject_libpath(env)
  17. # two-step update hint when using 1MB boards
  18. env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", check_printsize)
  19. # disable postmortem printing to the uart. another one is in eboot, but this is what causes the most harm
  20. if "DISABLE_POSTMORTEM_STACKDUMP" in env["CPPFLAGS"]:
  21. env.AddPostAction(
  22. "$BUILD_DIR/FrameworkArduino/core_esp8266_postmortem.c.o", dummy_ets_printf
  23. )
  24. env.AddPostAction(
  25. "$BUILD_DIR/FrameworkArduino/core_esp8266_postmortem.cpp.o", dummy_ets_printf
  26. )
  27. # patch lwip1 sources conditionally:
  28. # https://github.com/xoseperez/espurna/issues/1610
  29. lwip_inject_patcher(env)
  30. # when using git, add -DAPP_REVISION=(git-commit-hash)
  31. app_inject_revision(projenv)