Add makefile
This commit is contained in:
@ -1,23 +1,38 @@
|
|||||||
[tasks.build]
|
[tasks.build]
|
||||||
|
description = "Build the executable"
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = ["build"]
|
args = ["build"]
|
||||||
|
|
||||||
[tasks.objcopy]
|
[tasks.objcopy]
|
||||||
|
decsription = "Transform the binary for upload"
|
||||||
command = "arm-none-eabi-objcopy"
|
command = "arm-none-eabi-objcopy"
|
||||||
args = [
|
args = [
|
||||||
"-O", "binary",
|
"-O", "binary",
|
||||||
"target/thumbv6m-none-eabi/debug/neowatch",
|
"target/thumbv6m-none-eabi/debug/neowatch",
|
||||||
"target/thumbv6m-none-eabi/debug/neowatch.bin",
|
"target/thumbv6m-none-eabi/debug/neowatch.bin",
|
||||||
]
|
]
|
||||||
|
dependencies = ["build"]
|
||||||
|
|
||||||
[tasks.set_tty]
|
[tasks.wait_for_tty]
|
||||||
command = "stty"
|
decsription = "Wait for serial port to be available for upload"
|
||||||
args = [
|
script = [
|
||||||
"-F", "/dev/ttyACM0",
|
'''
|
||||||
"ospeed", "1200",
|
#!/bin/sh
|
||||||
|
while :; do
|
||||||
|
if touch /dev/ttyACM0; then
|
||||||
|
break
|
||||||
|
else
|
||||||
|
sleep 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
'''
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[tasks.test]
|
||||||
|
disabled = true
|
||||||
|
|
||||||
[tasks.upload]
|
[tasks.upload]
|
||||||
|
decsription = "Upload the program to the device"
|
||||||
command = "bossac"
|
command = "bossac"
|
||||||
args = [
|
args = [
|
||||||
"--info",
|
"--info",
|
||||||
@ -30,12 +45,5 @@ args = [
|
|||||||
"target/thumbv6m-none-eabi/debug/neowatch.bin",
|
"target/thumbv6m-none-eabi/debug/neowatch.bin",
|
||||||
"--reset",
|
"--reset",
|
||||||
]
|
]
|
||||||
dependencies = ["build"]
|
dependencies = ["objcopy", "wait_for_tty"]
|
||||||
#dependencies = ["set_tty", "build"]
|
|
||||||
|
|
||||||
[tasks.test]
|
|
||||||
disabled = true
|
|
||||||
|
|
||||||
[tasks.default]
|
|
||||||
dependencies = ["upload"]
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user