27 lines
605 B
Plaintext
Executable File
27 lines
605 B
Plaintext
Executable File
#!/usr/bin/env nu
|
|
|
|
# Build, flash, and run the firmware.
|
|
#
|
|
# Will also attach to serial logs
|
|
def main [
|
|
bin: string # Which firmware to run, 'left' or 'right'.
|
|
--serial (-s): string # The serial device to get logs from.
|
|
--probe (-p): bool # Flash & run using probe-run instead of elf2uf2
|
|
] {
|
|
if $probe {
|
|
cargo build --bin $bin
|
|
probe-run --chip RP2040 --speed 4000 ("./target/thumbv6m-none-eabi/debug/" + $bin)
|
|
} else {
|
|
cargo run --bin $bin
|
|
}
|
|
|
|
let log_script = ($env.FILE_PWD | path join "serial-logs")
|
|
|
|
if $serial == null {
|
|
nu $log_script
|
|
} else {
|
|
nu $log_script --serial $serial
|
|
}
|
|
}
|
|
|