예제 #1
0
파일: login.py 프로젝트: syscoin/firmware
 def __init__(self):
     self.is_setting = False
     self.is_repeat = False
     self.subtitle = False
     self.mk2 = version.is_mark2()
     self.offer_second = True
     self.reset()
예제 #2
0
async def start_selftest():
    import version

    try:
        await test_oled()
        await test_microsd()
        await test_numpad()
        await test_sflash()
        await test_ae508a()

        if version.is_mark2():
            await test_sd_active()

        # add more tests here

        settings.set('tested', True)
        await ux_show_story("Selftest complete", 'PASS')

    except (RuntimeError, AssertionError) as e:
        await ux_show_story("Test failed:\n" + str(e), 'FAIL')
예제 #3
0
파일: files.py 프로젝트: syscoin/firmware
    def setup(cls):
        # Watch the SD card-detect signal line... but very noisy
        # - this is called a few seconds after system startup

        from pyb import Pin, ExtInt

        def card_change(_):
            # Careful: these can come fast and furious!
            cls.last_change = utime.ticks_ms()

        cls.last_change = utime.ticks_ms()

        cls.irq = ExtInt(Pin('SD_SW'), ExtInt.IRQ_RISING_FALLING, Pin.PULL_UP,
                         card_change)

        # mark 2 boards have a light for SD activity.
        import version
        from machine import Pin

        if version.is_mark2():
            cls.active_led = Pin('SD_ACTIVE', Pin.OUT)
예제 #4
0
    MenuItem('Duress PIN', f=pin_changer, arg='duress'),
    MenuItem('Login Now', f=login_now, arg=1),
]


async def which_pin_menu(_1, _2, item):
    from main import pa
    return PinChangesMenu if not pa.is_secondary else SecondaryPinChangesMenu


SettingsMenu = [
    #         xxxxxxxxxxxxxxxx
    MenuItem('Idle Timeout', chooser=idle_timeout_chooser),
    MenuItem('Touch Setting',
             chooser=sensitivity_chooser,
             predicate=lambda: not version.is_mark2()),
    MenuItem('Max Network Fee', chooser=max_fee_chooser),
    MenuItem('PIN Options', menu=which_pin_menu),
    MenuItem('Multisig Wallets', menu=make_multisig_menu),
    MenuItem('Blockchain', chooser=chain_chooser),
]

SDCardMenu = [
    MenuItem("Verify Backup", f=verify_backup),
    MenuItem("Backup System", f=backup_everything),
    MenuItem("Dump Summary", f=dump_summary),
    MenuItem('Upgrade From SD', f=microsd_upgrade),
    MenuItem("Electrum Wallet", f=electrum_skeleton),
    MenuItem("Wasabi Wallet", f=wasabi_skeleton),
    MenuItem('List Files', f=list_files),
    #MenuItem('Reformat Card', f=wipe_microsd),      # removed: not reliable enuf
예제 #5
0
파일: main.py 프로젝트: Davdegreat/firmware
        pass

import ckcc
import uasyncio.core as asyncio

loop = asyncio.get_event_loop()

print("---\nColdcard Wallet from Coinkite Inc. (c) 2018.\n")

# Setup OLED and get something onto it.
from display import Display, FontFixed, FontSmall, FontLarge

dis = Display()
dis.splash()

if version.is_mark2():
    # Setup membrane numpad (mark 2)
    from mempad import MembraneNumpad
    numpad = MembraneNumpad(loop)
else:
    # Setup touch numpad (mark 1 hardware)
    from touchpad import TouchNumpad
    numpad = TouchNumpad(loop)

# Serial Flash memory
from sflash import SPIFlash

sf = SPIFlash()

# NV settings
from nvstore import SettingsObject