50 lines
863 B
TOML
50 lines
863 B
TOML
[tasks.build]
|
|
description = "Build the executable"
|
|
command = "cargo"
|
|
args = ["build"]
|
|
|
|
[tasks.objcopy]
|
|
decsription = "Transform the binary for upload"
|
|
command = "arm-none-eabi-objcopy"
|
|
args = [
|
|
"-O", "binary",
|
|
"target/thumbv6m-none-eabi/debug/neowatch",
|
|
"target/thumbv6m-none-eabi/debug/neowatch.bin",
|
|
]
|
|
dependencies = ["build"]
|
|
|
|
[tasks.wait_for_tty]
|
|
decsription = "Wait for serial port to be available for upload"
|
|
script = [
|
|
'''
|
|
#!/bin/sh
|
|
while :; do
|
|
if touch /dev/ttyACM0; then
|
|
break
|
|
else
|
|
sleep 1
|
|
fi
|
|
done
|
|
'''
|
|
]
|
|
|
|
[tasks.test]
|
|
disabled = true
|
|
|
|
[tasks.upload]
|
|
decsription = "Upload the program to the device"
|
|
command = "bossac"
|
|
args = [
|
|
"--info",
|
|
"--debug",
|
|
"--port=/dev/ttyACM0",
|
|
"--force_usb_port=true",
|
|
"--erase",
|
|
"--write",
|
|
"--verify",
|
|
"target/thumbv6m-none-eabi/debug/neowatch.bin",
|
|
"--reset",
|
|
]
|
|
dependencies = ["objcopy", "wait_for_tty"]
|
|
|