Skip to content

Commit 693a985

Browse files
3rdIterationclaude
andcommitted
fix: parseable firmware version, TDECK board type, SYM-mode PIN digits
The CI shallow/tagless checkout (plus the git dubious-ownership error inside the IDF container) made git describe fail, so JADE_VERSION in get_version_info was "1". Companion apps parse this as semver against a minimum firmware version and refuse to proceed (endless get_version_info retries / "please reconnect your hardware wallet"). Fetch full history and tags, mark the workspace safe for git in the container, and log the version at build time. Also report BOARD_TYPE "TDECK" instead of "UNKNOWN", and simplify PIN entry keys to actual ascii digits only - the T-Deck keyboard sends these with the SYM modifier held, so the letter-alias mapping is unnecessary. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent e056c0f commit 693a985

3 files changed

Lines changed: 10 additions & 14 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,16 @@ jobs:
1919
- uses: actions/checkout@v4
2020
with:
2121
submodules: recursive
22+
# Full history + tags so git describe produces a parseable
23+
# firmware version (companion apps reject e.g. "1")
24+
fetch-depth: 0
2225

2326
- name: Build ${{ matrix.variant.name }} firmware
2427
shell: bash
2528
run: |
2629
. /opt/esp/idf/export.sh
30+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
31+
echo "Firmware version: $(git describe --tags --always --dirty)"
2732
cp configs/${{ matrix.variant.config }} sdkconfig.defaults
2833
idf.py -B build_${{ matrix.variant.name }} set-target esp32s3
2934
idf.py -B build_${{ matrix.variant.name }} build

main/process/ota_defines.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
#define JADE_OTA_BOARD_TYPE "TTGO_TDISPLAYS3PROCAMERA"
4848
#elif defined(CONFIG_BOARD_TYPE_WS_TOUCH_LCD2)
4949
#define JADE_OTA_BOARD_TYPE "WAVESHARE_TOUCH_LCD2"
50+
#elif defined(CONFIG_BOARD_TYPE_TDECK)
51+
#define JADE_OTA_BOARD_TYPE "TDECK"
5052
#elif defined(CONFIG_BOARD_TYPE_QEMU) || defined(CONFIG_BOARD_TYPE_QEMU_LARGER)
5153
#define JADE_OTA_BOARD_TYPE "QEMU"
5254
#else

main/ui/digit_entry.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
#include "../random.h"
55
#include "../ui.h"
66

7-
#ifdef CONFIG_HAS_KEYBOARD
8-
#include <ctype.h>
9-
#include <string.h>
10-
#endif
117

128
#define CHAR_BACKSPACE '|'
139
#define CHAR_ENTER '~'
@@ -208,24 +204,17 @@ static bool prev_selected_digit(digit_entry_t* digit_entry)
208204
}
209205

210206
#ifdef CONFIG_HAS_KEYBOARD
211-
// Map physical key events to digits. Accept actual ascii digits, plus the
212-
// letter keys which have digits printed on them on the T-Deck keyboard:
213-
// w=1 e=2 r=3 s=4 d=5 f=6 z=7 x=8 c=9 (0 is on the mic key).
207+
// Map physical key events to digits - only actual ascii digits qualify
208+
// (on the T-Deck keyboard these are typed with the SYM modifier held)
214209
static int keyboard_event_digit(const int32_t ev_id)
215210
{
216-
static const char digit_key_aliases[] = "wersdfzxc"; // 1-9
217-
218211
if (ev_id <= BTN_KEYBOARD_ASCII_OFFSET) {
219212
return -1;
220213
}
221-
const int ch = tolower(ev_id - BTN_KEYBOARD_ASCII_OFFSET);
214+
const int ch = ev_id - BTN_KEYBOARD_ASCII_OFFSET;
222215
if (ch >= '0' && ch <= '9') {
223216
return ch - '0';
224217
}
225-
const char* const alias = strchr(digit_key_aliases, ch);
226-
if (alias) {
227-
return (alias - digit_key_aliases) + 1;
228-
}
229218
return -1;
230219
}
231220

0 commit comments

Comments
 (0)