Skip to content

Commit

Permalink
add: run script for probe and u2f
Browse files Browse the repository at this point in the history
  • Loading branch information
daystram committed Sep 1, 2024
1 parent 473ca52 commit d4b5def
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
[alias]
run_probe = [
"--config",
"target.'cfg(all(target_arch = \"arm\", target_os = \"none\"))'.runner = 'probe-rs run --chip RP2040'",
"run",
]
run_u2f = [
"--config",
"target.'cfg(all(target_arch = \"arm\", target_os = \"none\"))'.runner = 'elf2uf2-rs -d'",
"run",
]

[target.'cfg(all(target_arch = "arm", target_os = "none"))']
runner = "probe-rs run --chip RP2040"
# runner = "elf2uf2-rs -d"
rustflags = [
"-C",
"linker=flip-link",
Expand Down
4 changes: 4 additions & 0 deletions .envrc.sample
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
export KEYBOARD=default
export LAYOUT=default

# VID, PID, and Serial are obtained from `probe-rs list`
export LEFT_PROBE="vid:pid:serial"
export RIGHT_PROBE="vid:pid:serial"
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
CARGO:=$(shell which cargo)

.PHONY: build
build:
${CARGO} build

.PHONY: lint
lint:
${CARGO} clippy

.PHONY: run_u2f
run_u2f:
${CARGO} run_u2f

.PHONY: run_probe_left
run_probe_left:
${CARGO} run_probe -- --probe ${LEFT_PROBE}

.PHONY: run_probe_right
run_probe_right:
${CARGO} run_probe -- --probe ${RIGHT_PROBE}

0 comments on commit d4b5def

Please sign in to comment.