Skip to content

Commit

Permalink
Remove serial # display & don't boot to firmware after test is complete
Browse files Browse the repository at this point in the history
  • Loading branch information
FoundationKen committed May 25, 2021
1 parent e685de5 commit 287ff55
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 26 deletions.
8 changes: 2 additions & 6 deletions ports/stm32/boards/Passport/modules/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,18 @@ async def about_info(*a):
from utils import swab32

while True:
serial = system.get_serial_number()
my_xfp = settings.get('xfp', 0)
xpub = settings.get('xpub', None)

msg = '''Serial Number:
{serial}
msg = '''
Master Fingerprint:
{xfp}
Reversed Fingerprint:
{rev_xfp}
Master XPUB:
{xpub}'''.format(serial=serial,
xfp=xfp2str(my_xfp) if my_xfp else '<No Seed Yet>',
{xpub}'''.format(xfp=xfp2str(my_xfp) if my_xfp else '<No Seed Yet>',
rev_xfp=xfp2str(swab32(my_xfp)) if my_xfp else '<No Seed Yet>',
xpub=xpub if xpub != None else '<No Seed Yet>')

Expand Down
38 changes: 18 additions & 20 deletions ports/stm32/boards/Passport/modules/self_test_ux.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,30 +53,20 @@ class SelfTestUX(UXStateMachine):

def __init__(self):
# States
self.SHOW_SERIAL_NUMBER = 1
self.KEYPAD_TEST = 2
self.CAMERA_TEST = 3
self.CAMERA_TEST_RESULT = 4
self.SCREEN_ALIGNMENT = 5
self.MICROSD_TEST = 6
self.KEYPAD_TEST = 1
self.CAMERA_TEST = 2
self.CAMERA_TEST_RESULT = 3
self.SCREEN_ALIGNMENT = 4
self.MICROSD_TEST = 5
self.TESTS_COMPLETE = 6
self.qr_data = None

# print('SelfTestUX init')
super().__init__(self.SHOW_SERIAL_NUMBER)
super().__init__(self.KEYPAD_TEST)

async def show(self):
while True:
# print('show: state={}'.format(self.state))
if self.state == self.SHOW_SERIAL_NUMBER:
serial = system.get_serial_number()
result = await ux_show_text_as_ur(title='Serial Num.', qr_text=serial, qr_type=QRType.QR, msg=serial,
right_btn='NEXT') # If right_btn is specified, then RESIZE doesn't appear/work, which is fine here
if result == 'x':
return
else:
self.goto(self.KEYPAD_TEST)

elif self.state == self.KEYPAD_TEST:
if self.state == self.KEYPAD_TEST:
# print('Keypad Test!')
result = await ux_keypad_test()
if result == 'x':
Expand Down Expand Up @@ -117,8 +107,16 @@ async def show(self):
elif self.state == self.MICROSD_TEST:
# Describe the microSD test
result = await ux_show_story('This test will exercise the read/write features of the microSD card.', title='microSD Test', right_btn='START', center=True, center_vertically=True)
if result == 'x':
self.goto_prev()
continue

if await microsd_test():
self.goto(self.TESTS_COMPLETE)

elif self.state == self.TESTS_COMPLETE:
result = await ux_show_story('All tests complete!', title='Complete', right_btn='SHUTDOWN', center=True, center_vertically=True)
if result == 'x':
self.goto_prev()
else:
await microsd_test()
return
system.shutdown()

0 comments on commit 287ff55

Please sign in to comment.