From 82cf526f43e7cd16ece1a3dacbe2e9fed14aa744 Mon Sep 17 00:00:00 2001 From: "Peter D. Gray" Date: Thu, 19 Jan 2023 10:57:59 -0500 Subject: [PATCH] more q1 capabilities --- shared/version.py | 10 +++++++--- unix/variant/version.py | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/shared/version.py b/shared/version.py index c890a515..c3999711 100644 --- a/shared/version.py +++ b/shared/version.py @@ -75,7 +75,7 @@ def serial_number(): def probe_system(): # run-once code to determine what hardware we are running on global hw_label, has_608, is_factory_mode, is_devmode - global has_se2, mk_num, has_nfc, has_qr, num_sd_slots + global has_se2, mk_num, has_nfc, has_qr, num_sd_slots, has_qwerty, has_battery global MAX_UPLOAD_LEN, MAX_TXN_LEN from sigheader import RAM_BOOT_FLAGS, RBF_FACTORY_MODE @@ -87,18 +87,22 @@ def probe_system(): has_qr = False # QR scanner num_sd_slots = 1 # might have dual slots on Q1 mk_num = 4 + has_battery = False + has_qwerty = False cpuid = ckcc.get_cpu_id() assert cpuid == 0x470 # STM32L4S5VI # detect Q1 based on pins.csv try: - machine.Pin('LCD_TEAR') # only on Q1 build, will error otherwise + machine.Pin('LCD_TEAR') # only defined on Q1 build, will error otherwise has_qr = True num_sd_slots = 2 hw_label = 'q1' + has_battery = True + has_qwerty = True # but, still mk_num = 4 - except: + except ValueError: pass # Boot loader needs to tell us stuff about how we were booted, sometimes: diff --git a/unix/variant/version.py b/unix/variant/version.py index 39a18624..910149d7 100644 --- a/unix/variant/version.py +++ b/unix/variant/version.py @@ -42,6 +42,8 @@ has_psram = True has_nfc = True has_qr = False num_sd_slots = 1 +has_battery = False +has_qwerty = False if '--mk1' in sys.argv: # doubt this works still @@ -75,6 +77,8 @@ if '--q1' in sys.argv: hw_label = 'q1' has_qr = True num_sd_slots = 2 + has_battery = True + has_qwerty = True from public_constants import MAX_TXN_LEN, MAX_UPLOAD_LEN from public_constants import MAX_TXN_LEN_MK4, MAX_UPLOAD_LEN_MK4