|
|
@ -46,20 +46,12 @@ def remove_float_support(): |
|
|
|
LINKFLAGS = newflags |
|
|
|
) |
|
|
|
|
|
|
|
def cpp_check(source, target, env): |
|
|
|
print("Started cppcheck...\n") |
|
|
|
call(["cppcheck", os.getcwd()+"/espurna", "--force", "--enable=all"]) |
|
|
|
print("Finished cppcheck...\n") |
|
|
|
|
|
|
|
def check_size(source, target, env): |
|
|
|
time.sleep(2) |
|
|
|
size = target[0].get_size() |
|
|
|
print clr(Color.LIGHT_BLUE, "Binary size: %s bytes" % size) |
|
|
|
#if size > 512000: |
|
|
|
# print clr(Color.LIGHT_RED, "File too large for OTA!") |
|
|
|
# Exit(1) |
|
|
|
|
|
|
|
def build_webui(source, target, env): |
|
|
|
def build_webui(): |
|
|
|
config = util.load_project_config() |
|
|
|
kv = dict(config.items("env:" + env.get('PIOENV'))) |
|
|
|
if 'modules' in kv: |
|
|
@ -71,7 +63,6 @@ def build_webui(source, target, env): |
|
|
|
# ------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
remove_float_support() |
|
|
|
build_webui() |
|
|
|
|
|
|
|
#env.AddPreAction("buildprog", cpp_check) |
|
|
|
env.AddPreAction("$BUILD_DIR/src/espurna.ino.cpp.o", build_webui) |
|
|
|
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", check_size) |