diff options
author | Adrian Kummerlaender | 2021-10-10 22:19:37 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2021-10-10 22:19:37 +0200 |
commit | 575e958657a50dfe3d335e6af9489c0bea246a4b (patch) | |
tree | 3fd6ee516605e92b61cad4056c1ce7bd294379af | |
parent | bdd2cb7b9a1d9d1e34e1c838311a57a9ea552516 (diff) | |
download | teensy-env-575e958657a50dfe3d335e6af9489c0bea246a4b.tar teensy-env-575e958657a50dfe3d335e6af9489c0bea246a4b.tar.gz teensy-env-575e958657a50dfe3d335e6af9489c0bea246a4b.tar.bz2 teensy-env-575e958657a50dfe3d335e6af9489c0bea246a4b.tar.lz teensy-env-575e958657a50dfe3d335e6af9489c0bea246a4b.tar.xz teensy-env-575e958657a50dfe3d335e6af9489c0bea246a4b.tar.zst teensy-env-575e958657a50dfe3d335e6af9489c0bea246a4b.zip |
Add loader commands
e.g. "nix run .#flash-ulisp" flashes ulisp to the attached Teensy 4.0 board
-rw-r--r-- | build.nix | 11 | ||||
-rw-r--r-- | flake.nix | 6 |
2 files changed, 17 insertions, 0 deletions
@@ -27,4 +27,15 @@ cp *.hex $out/ ''; }; + + flash = let + loader = name: path: pkgs.writeScript name '' + #!/bin/sh + ${pkgs.teensy-loader-cli}/bin/teensy-loader-cli --mcu=TEENSY40 -w ${path} + ''; + + in drv: file: { + type = "app"; + program = ''${loader file "${drv}/${file}.hex"}''; + }; } @@ -25,5 +25,11 @@ packages.${system} = { inherit teensy-core teensy-test teensy-ulisp; }; + + apps.${system} = { + flash-blink = image.flash teensy-test "blink"; + flash-counter = image.flash teensy-test "counter"; + flash-ulisp = image.flash teensy-ulisp "ulisp-arm"; + }; }; } |