Skip to content

Commit

Permalink
add flash app to flake
Browse files Browse the repository at this point in the history
  • Loading branch information
hall committed Jan 15, 2023
1 parent 757f490 commit 1ce81d1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 |
| ------ | -------------- | -------------- | ----------- |
Expand All @@ -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

Expand All @@ -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

Expand Down
11 changes: 11 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1ce81d1

Please sign in to comment.