version.is_edge value

This commit is contained in:
Peter D. Gray 2023-05-09 10:17:54 -04:00
parent 8d7f6dee7a
commit 0883d6f347
No known key found for this signature in database
GPG Key ID: F0E6CC6AFC16CF7B
4 changed files with 25 additions and 14 deletions

View File

@ -918,14 +918,13 @@ async def start_login_sequence():
# is early in boot process
print("XFP save failed: %s" % exc)
# reckless warning before HSM is offered to also warn HSM users
_, ver, _ = version.get_mpy_version()
if ver[-1] == "X":
await ux_show_story(title="Reckless!!!",
msg=("Bleeding Edge Firmware\n\nThis preview version of firmware has not yet"
" been qualified and tested to the same standard as most Coinkite products."
"\n\nIt is recommended only for developers and early adopters for experimental use. "
"DO NOT use for large Bitcoin values."))
# Version warning before HSM is offered
if version.is_edge:
await ux_show_story(
"This preview version of firmware has not yet been qualified and "
"tested to the same standard as normal Coinkite products."
"\n\nIt is recommended only for developers and early adopters for experimental use. "
"DO NOT use for large Bitcoin amounts.", title="Edge Version")
# If HSM policy file is available, offer to start that,
# **before** the USB is even enabled.

View File

@ -4,7 +4,7 @@
#
import machine, ssd1306, uzlib, ckcc, utime
from ssd1306 import SSD1306_SPI
from version import is_devmode
from version import is_devmode, is_edge
import framebuf
import uasyncio
from uasyncio import sleep_ms
@ -134,10 +134,16 @@ class Display:
self.dis.fill_rect(128-2, pos, 1, 8, 1)
if is_devmode and not ckcc.is_simulator():
self.dis.fill_rect(128-6, 20, 5, 21, 1)
self.text(-2, 21, 'D', font=FontTiny, invert=1)
self.text(-2, 28, 'E', font=FontTiny, invert=1)
self.text(-2, 35, 'V', font=FontTiny, invert=1)
self.dis.fill_rect(128-5, 20, 5, 21, 1)
self.text(-1, 21, 'D', font=FontTiny, invert=1)
self.text(-1, 28, 'E', font=FontTiny, invert=1)
self.text(-1, 35, 'V', font=FontTiny, invert=1)
elif is_edge:
self.dis.fill_rect(128-5, 19, 5, 26, 1)
self.text(-1, 20, 'E', font=FontTiny, invert=1)
self.text(-1, 27, 'D', font=FontTiny, invert=1)
self.text(-1, 33, 'G', font=FontTiny, invert=1)
self.text(-1, 39, 'E', font=FontTiny, invert=1)
def fullscreen(self, msg, percent=None, line2=None):
# show a simple message "fullscreen".

View File

@ -79,6 +79,7 @@ def get_is_devmode():
def is_fresh_version():
# Did we just boot into a new firmware for the first time?
# - mk4+ does not use this approach, light will be solid green during upgrade
if mk_num >= 4: return False
@ -103,7 +104,7 @@ def serial_number():
def probe_system():
# run-once code to determine what hardware we are running on
global hw_label, has_608, has_fatram, is_factory_mode, is_devmode, has_psram
global has_se2, mk_num, has_nfc
global has_se2, mk_num, has_nfc, is_edge
global MAX_UPLOAD_LEN, MAX_TXN_LEN
from sigheader import RAM_BOOT_FLAGS, RBF_FACTORY_MODE
@ -154,6 +155,9 @@ def probe_system():
# what firmware signing key did we boot with? are we in dev mode?
is_devmode = get_is_devmode()
# newer, edge code in effect?
is_edge = (get_mpy_version()[1][-1] == 'X')
# increase size limits for mk4
if has_psram:
from public_constants import MAX_TXN_LEN_MK4, MAX_UPLOAD_LEN_MK4

View File

@ -21,6 +21,8 @@ is_factory_mode = bool('-f' in sys.argv)
is_devmode = True
is_edge = True
def is_fresh_version():
return False