mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-14 12:17:11 +01:00
- provide a queue for the outgoing messages, don't depend on the MQTT callback implementation details and always postpone the actual transfer. - generate user input parsers using re2c, adds special PlatformIO build handlers - add terminal command to show GPIO info and send a simple payload - rework button<->action presets into value<->terminal command presets and custom ones through the use of `irCmd<VALUE>` settings, where the VALUE is taken from the simple payload (yet, it does not understand repeated codes, but that's something to add later *or* use rpnlib) - add tx message integration for the relay module via `irRelayOn#` and `irRelayOff#` - rework simple payload to include 'repeats' value for the 'IRsend::send()' also adds internal 'series', 'delay' and includes full 64bit 'value' (as uppercase HEX, instead of decimal) - rework raw payload to use 'series' instead of 'repeats', and provide a clear distinction between the usec time and the options of the message by moving the required options to the front and separating them using ':' (just like the simple variant) - make RX and TX pin a runtime setting, make RX and TX support a build flag - small test framework to check whether internal string encode<->decode works Also updates the hexEncode & hexDecode implementations to use 'iterators' instead of just pointer + index.
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
import os
|
|
|
|
from .display import Color, clr, print_filler, print_warning
|
|
|
|
def check_env(name, default):
|
|
return os.environ.get(name, default) in ("1", "y", "yes", "true")
|
|
|
|
|
|
def check_printsize(target, source, env):
|
|
(binary,) = target
|
|
path = binary.get_abspath()
|
|
size = os.stat(path).st_size
|
|
print(clr(Color.LIGHT_BLUE, "Binary size: {} bytes".format(size)))
|
|
|
|
# Warn 1MB variants about exceeding OTA size limit
|
|
flash_size = int(env.BoardConfig().get("upload.maximum_size", 0))
|
|
if (flash_size == 1048576) and (size >= 512000):
|
|
print_filler("*", color=Color.LIGHT_YELLOW, err=True)
|
|
print_warning(
|
|
"File is too large for OTA! Here you can find instructions on how to flash it:"
|
|
)
|
|
print_warning(
|
|
"https://github.com/xoseperez/espurna/wiki/TwoStepUpdates",
|
|
color=Color.LIGHT_CYAN,
|
|
)
|
|
print_filler("*", color=Color.LIGHT_YELLOW, err=True)
|
|
|
|
|
|
def check_cppcheck(target, source, env):
|
|
print_warning("Started cppcheck...\n")
|
|
call(["cppcheck", os.getcwd() + "/espurna", "--force", "--enable=all"])
|
|
print_warning("Finished cppcheck...\n")
|