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.

29 lines
1.0 KiB

  1. import os
  2. from .display import Color, clr, print_filler, print_warning
  3. def check_printsize(target, source, env):
  4. (binary,) = target
  5. path = binary.get_abspath()
  6. size = os.stat(path).st_size
  7. print(clr(Color.LIGHT_BLUE, "Binary size: {} bytes".format(size)))
  8. # Warn 1MB variants about exceeding OTA size limit
  9. flash_size = int(env.BoardConfig().get("upload.maximum_size", 0))
  10. if (flash_size == 1048576) and (size >= 512000):
  11. print_filler("*", color=Color.LIGHT_YELLOW, err=True)
  12. print_warning(
  13. "File is too large for OTA! Here you can find instructions on how to flash it:"
  14. )
  15. print_warning(
  16. "https://github.com/xoseperez/espurna/wiki/TwoStepUpdates",
  17. color=Color.LIGHT_CYAN,
  18. )
  19. print_filler("*", color=Color.LIGHT_YELLOW, err=True)
  20. def check_cppcheck(target, source, env):
  21. print_warning("Started cppcheck...\n")
  22. call(["cppcheck", os.getcwd() + "/espurna", "--force", "--enable=all"])
  23. print_warning("Finished cppcheck...\n")