|
@ -58,18 +58,6 @@ def check_size(source, target, env): |
|
|
# print clr(Color.LIGHT_RED, "File too large for OTA!") |
|
|
# print clr(Color.LIGHT_RED, "File too large for OTA!") |
|
|
# Exit(1) |
|
|
# Exit(1) |
|
|
|
|
|
|
|
|
def add_build_flags(source, target, env): |
|
|
|
|
|
build_h = "espurna/config/build.h" |
|
|
|
|
|
build_flags = env['BUILD_FLAGS'][0] |
|
|
|
|
|
lines = open(build_h).readlines() |
|
|
|
|
|
with open(build_h, "w") as fh: |
|
|
|
|
|
for line in lines: |
|
|
|
|
|
if "APP_BUILD_FLAGS" in line: |
|
|
|
|
|
fh.write("#define APP_BUILD_FLAGS \"%s\"" % build_flags) |
|
|
|
|
|
else: |
|
|
|
|
|
fh.write(line) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------ |
|
|
# ------------------------------------------------------------------------------ |
|
|
# Hooks |
|
|
# Hooks |
|
|
# ------------------------------------------------------------------------------ |
|
|
# ------------------------------------------------------------------------------ |
|
@ -77,5 +65,4 @@ def add_build_flags(source, target, env): |
|
|
remove_float_support() |
|
|
remove_float_support() |
|
|
|
|
|
|
|
|
#env.AddPreAction("buildprog", cpp_check) |
|
|
#env.AddPreAction("buildprog", cpp_check) |
|
|
env.AddPreAction("$BUILD_DIR/src/espurna.ino.o", add_build_flags) |
|
|
|
|
|
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", check_size) |
|
|
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", check_size) |