Skip to content

Commit 83f884a

Browse files
authored
make reset target work for gen2 (#18)
1 parent dc1908e commit 83f884a

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,15 @@ pio device monitor
4545
## Back to Normal
4646
To get your Tidbyt back to normal, you can run the following to flash the
4747
production firmware onto your Tidbyt:
48+
49+
```
50+
pio run --target reset --environment tidbyt
51+
```
52+
53+
And if you're working with a Tidbyt Gen 2:
54+
4855
```
49-
pio run --target reset
56+
pio run --target reset --environment tidbyt-gen2
5057
```
5158

5259
[1]: https://github.com/tidbyt/pixlet

extra_scripts/reset.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33
import os.path
44
import requests
55

6-
PRODUCTION_VERSION = "v10/26961"
6+
PRODUCTION_VERSION = {
7+
"tidbyt": "v10/35369",
8+
"tidbyt-gen2": "v11/35369"
9+
}[env["PIOENV"]]
710

811
def fetch_firmware():
12+
913
binaries = [
1014
"firmware.bin",
1115
"partitions.bin",
@@ -22,7 +26,7 @@ def fetch_firmware():
2226
r = requests.get(f"https://storage.googleapis.com/tidbyt-public-firmware/{PRODUCTION_VERSION}/{binary}")
2327
if r.status_code != 200:
2428
raise Exception(f"Failed to fetch {binary}: {r.status_code}")
25-
29+
2630
with open(f".production/{PRODUCTION_VERSION}/{binary}", "wb") as f:
2731
f.write(r.content)
2832

@@ -58,4 +62,4 @@ def fetch_firmware():
5862
RESET_UPLOADCMD='"$PYTHONEXE" "$RESET_UPLOADER" $RESET_UPLOADERFLAGS'
5963
)
6064

61-
env.AddCustomTarget("reset", None, actions=['$RESET_UPLOADCMD'])
65+
env.AddCustomTarget("reset", None, actions=['$RESET_UPLOADCMD'])

0 commit comments

Comments
 (0)