mirror of
https://github.com/Architeuthis-Flux/Jumperless.git
synced 2024-11-28 01:11:00 +01:00
24 lines
602 B
Python
24 lines
602 B
Python
|
Import("env")
|
||
|
|
||
|
def after_upload(source, target, env):
|
||
|
port = env.GetProjectOption("monitor_port")
|
||
|
print("waiting for " + port + " ...")
|
||
|
import serial
|
||
|
while True:
|
||
|
try:
|
||
|
s = serial.Serial(port)
|
||
|
break
|
||
|
except:
|
||
|
pass
|
||
|
|
||
|
env.AddPostAction("upload", after_upload)
|
||
|
|
||
|
|
||
|
# Custom HEX from ELF
|
||
|
env.AddPostAction(
|
||
|
"$BUILD_DIR/${PROGNAME}.elf",
|
||
|
env.VerboseAction(" ".join([
|
||
|
"$OBJCOPY", "-O", "ihex", "-R", ".eeprom",
|
||
|
'"$BUILD_DIR/${PROGNAME}.elf"', '"$BUILD_DIR/${PROGNAME}.hex"'
|
||
|
]), "Building $BUILD_DIR/${PROGNAME}.hex")
|
||
|
)
|