-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathcommon.py
85 lines (58 loc) · 1.57 KB
/
common.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# SPDX-FileCopyrightText: © 2020 Foundation Devices, Inc. <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
#
# common.py - Shared global values
# Get the async event loop to pass in where needed
from animations.constants import TRANSITION_DIR_REPLACE
import utime
loop = None
# System
system = None
# Keypad
keypad = None
# Internal flash-based settings
settings = None
# External SPI flash cache
flash_cache = None
# Display
display = None
# UI
ui = None
# PinAttempts
pa = None
# External SPI Flash
sf = None
# Avalanche noise source
noise = None
# Demo
demo_active = False
demo_count = 0
# Last time the user interacted (i.e., pressed/released any key)
last_activity_time = utime.ticks_ms()
# Screenshot mode
screenshot_mode_enabled = False
# Snapshot mode
snapshot_mode_enabled = False
# Power monitor
powermon = None
# Battery Monitor
enable_battery_mon = False
# Active account
active_account = None
# The QRType of the last QR code that was scanned
last_scanned_qr_type = None
last_scanned_ur_prefix = None
# Cached Developer PubKey
cached_pubkey = None
is_old_gen12_dev_board = False
# Input Device for keypad for LVGL
keypad_indev = None
is_dark_theme = True
# Custom events id dict
custom_events = {}
# What type of transition should be done for the next page transition?
page_transition_dir = TRANSITION_DIR_REPLACE
# What type of transition should be done for the next card transition?
card_transition_dir = TRANSITION_DIR_REPLACE
# Flag to prevent auto-shutdown related brightness from interfering with QR-related brightness
showing_qr = False