diff --git a/README.md b/README.md index 1f15b8d..6a11e21 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Little Buddy -Firmware for the [PineBuds Pro](https://wiki.pine64.org/wiki/PineBuds_Pro). Hopefully. +Firmware for the [PineBuds Pro](https://wiki.pine64.org/wiki/PineBuds_Pro). -> **WARNING**: use at your own risk; this is currently worse than the factory default +> **NOTE**: currently lacking functionality found in the factory default firmware (mainly, ANC) -The following button taps/hold actions are currently mapped: +The following button actions are mapped: | taps | single bud | left | right | | ------ | -------------- | -------------- | ----------- | @@ -16,14 +16,13 @@ The following button taps/hold actions are currently mapped: ## install -Download the latest [release](https://github.com/hall/little-buddy/releases). +Download the latest [release](https://github.com/hall/little-buddy/releases) then flash both earbuds with -Flash both earbuds with [`bestool`](https://github.com/Ralim/bestool): +```sh +nix run 'github:hall/little-buddy#flash' little-buddy-*.bin +``` - bestool write-image --port /dev/ttyACM0 little-buddy-*.bin - bestool write-image --port /dev/ttyACM1 little-buddy-*.bin - -> **NOTE**: if you have [nix](https://nixos.org/download.html) installed, you can use `nix run 'github:hall/little-buddy#bestool'` instead of building and installing it yourself +> **NOTE**: if you don't want to use [nix](https://nixos.org/download.html), you can use [`bestool`](https://github.com/Ralim/bestool) directly ## languages @@ -43,12 +42,12 @@ The following languages of audio alerts are currently supported: | русский | Russian | ru | | 中国人 | Chinese | zh | -As they are autogenerated, new languages are both easy to add and likely to have inconsistencies. -Feel free to open an issue in either case. +> **NOTE**: as they are autogenerated, new languages are both easy to add and likely to have inconsistencies; feel free to open an issue in either case. + ## attribution Thus far, I've written almost none of this. -All credit goes to the original authors. +Credit goes to the original authors. ### name diff --git a/flake.nix b/flake.nix index 8dabcfd..4c373a5 100644 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,17 @@ let pkgs = inputs.nixpkgs.legacyPackages.${system}; in { apps = { + flash = inputs.utils.lib.mkApp { + drv = pkgs.writeShellScriptBin "tts" '' + # should correctly identify the pinebuds + id=/dev/serial/by-id/usb-wch.cn_USB_Dual_Serial_0123456789-if + for i in 00 02; do + # use the given file or a default + [ $# -eq 1 ] && bin=$1 || bin=result/little-buddy-*-''${LANGUAGE:-en}.bin + ${self.packages.${system}.bestool}/bin/bestool write-image --port $id$i $bin + done + ''; + }; tts = inputs.utils.lib.mkApp { drv = pkgs.writeShellScriptBin "tts" '' LANGUAGE=$1