Skip to content

Commit 626cc0e

Browse files
3rdIterationk9ert
authored andcommitted
Fix for newer GM65 Scanners scanning CompactSeedQR + Add "About Screen" (#299)
1 parent 171d673 commit 626cc0e

File tree

9 files changed

+596
-48
lines changed

9 files changed

+596
-48
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ release
99
.vscode
1010
.DS_Store
1111
.direnv
12+
src/git_info.py

Makefile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ FROZEN_MANIFEST_DEBUG ?= ../../../../manifests/debug.py
1313
FROZEN_MANIFEST_UNIX ?= ../../../../manifests/unix.py
1414
DEBUG ?= 0
1515
USE_DBOOT ?= 0
16+
GIT_INFO ?= src/git_info.py
1617

1718
$(TARGET_DIR):
1819
mkdir -p $(TARGET_DIR)
@@ -29,8 +30,13 @@ mpy-cross: $(TARGET_DIR) $(MPY_DIR)/mpy-cross/Makefile
2930
CFLAGS_EXTRA="$(MPY_CFLAGS)" && \
3031
cp $(MPY_DIR)/mpy-cross/mpy-cross $(TARGET_DIR)
3132

33+
# embed git metadata for firmware builds
34+
.PHONY: git-info
35+
git-info:
36+
./tools/embed_git_info.py $(GIT_INFO)
37+
3238
# disco board with bitcoin library
33-
disco: $(TARGET_DIR) mpy-cross $(MPY_DIR)/ports/stm32
39+
disco: $(TARGET_DIR) mpy-cross $(MPY_DIR)/ports/stm32 git-info
3440
@echo Building firmware
3541
make -C $(MPY_DIR)/ports/stm32 \
3642
BOARD=$(BOARD) \
@@ -47,7 +53,7 @@ disco: $(TARGET_DIR) mpy-cross $(MPY_DIR)/ports/stm32
4753
$(TARGET_DIR)/specter-diy.hex
4854

4955
# disco board with bitcoin library
50-
debug: $(TARGET_DIR) mpy-cross $(MPY_DIR)/ports/stm32
56+
debug: $(TARGET_DIR) mpy-cross $(MPY_DIR)/ports/stm32 git-info
5157
@echo Building firmware
5258
make -C $(MPY_DIR)/ports/stm32 \
5359
BOARD=$(BOARD) \
@@ -65,7 +71,7 @@ debug: $(TARGET_DIR) mpy-cross $(MPY_DIR)/ports/stm32
6571

6672

6773
# unixport (simulator)
68-
unix: $(TARGET_DIR) mpy-cross $(MPY_DIR)/ports/unix
74+
unix: $(TARGET_DIR) mpy-cross $(MPY_DIR)/ports/unix git-info
6975
@echo Building binary with frozen files
7076
make -C $(MPY_DIR)/ports/unix \
7177
USER_C_MODULES=$(USER_C_MODULES) \
@@ -92,4 +98,4 @@ clean:
9298
USER_C_MODULES=$(USER_C_MODULES) \
9399
FROZEN_MANIFEST=$(FROZEN_MANIFEST_DISCO) clean
94100

95-
.PHONY: all clean
101+
.PHONY: all clean git-info

boot/debug/boot.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ def poweroff(_):
3737
# os.dupterm(None,1)
3838

3939
# inject version to platform module
40-
import platform
41-
platform.version = version
40+
import platform
41+
platform.version = version
42+
platform.bootloader_locked = False
43+
platform.build_type = "debug"
4244

4345
# uncomment to run some custom main:
4446
pyb.main("hardwaretest.py")

boot/main/boot.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ def poweroff(_):
5959
os.dupterm(None,1)
6060

6161
# inject version and i2c to platform module
62-
import platform
63-
platform.version = version
64-
platform.i2c = i2c
62+
import platform
63+
platform.version = version
64+
platform.i2c = i2c
65+
platform.bootloader_locked = True
66+
platform.build_type = "disco"

src/gui/screens/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ def __init__(self, controls, title="Host setttings", note=None, controls_empty_t
2929
switch.on(lv.ANIM.OFF)
3030
self.switches.append(switch)
3131
y = lbl.get_y() + 80
32-
else:
32+
self.next_y = y
33+
if not controls:
3334
label = add_label(controls_empty_text, y, scr=self.page)
35+
self.next_y = label.get_y() + label.get_height() + 40
3436
self.confirm_button.set_event_cb(on_release(self.update))
3537
self.cancel_button.set_event_cb(on_release(lambda: self.set_value(None)))
3638

0 commit comments

Comments
 (0)