else: if "FRAMEWORK" not in env: target_firm = env.ElfToBin([ join("$BUILD_DIR", "firmware_00000"), join("$BUILD_DIR", "firmware_40000") ], target_elf) else: target_firm = env.ElfToBin(join("$BUILD_DIR", "firmware"), target_elf) # # Target: Print binary size # target_size = env.Alias("size", target_elf, "$SIZEPRINTCMD") AlwaysBuild(target_size) # # Target: Upload firmware or SPIFFS image # target_upload = env.Alias( ["upload", "uploadlazy", "uploadfs"], target_firm, [lambda target, source, env: env.AutodetectUploadPort(), "$UPLOADCMD"]) env.AlwaysBuild(target_upload) # # Target: Define targets # Default([target_firm, target_size])
upload_program = join(FRAMEWORK_DIR, "tools", "artemis", sys_pf.system().lower(), "artemis_svl") if sys_pf.system() == "Windows": upload_program += ".exe" elif sys_pf.system().lower() in ["darwin"]: upload_program = join(FRAMEWORK_DIR, "tools", "artemis", "macosx", "artemis_svl") upload_speed = env.subst("$UPLOAD_SPEED") if len(upload_speed) == 0: upload_speed = "921600" upload_port = env.subst("$UPLOAD_PORT") if len(upload_port) == 0: env.AutodetectUploadPort() # env.Replace( # UPLOADER=upload_program, # UPLOADERFLAGS=[ # "$UPLOAD_PORT", # "-b", "921600", # "-f", "$SOURCES", # "-v", # ], # UPLOADCMD="$UPLOADER $UPLOADERFLAGS" # ) # A full list with the available variables # http://www.scons.org/doc/production/HTML/scons-user.html#app-variables env.Replace(AR="arm-none-eabi-ar",