mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-21 23:18:13 +00:00
modtrezorconfig: Chenge ui_wait_callback() to return secbool.
This commit is contained in:
parent
c106e81a05
commit
36f354714d
@ -30,10 +30,13 @@
|
||||
|
||||
STATIC mp_obj_t ui_wait_callback = mp_const_none;
|
||||
|
||||
STATIC void wrapped_ui_wait_callback(uint32_t wait, uint32_t progress) {
|
||||
STATIC secbool wrapped_ui_wait_callback(uint32_t wait, uint32_t progress) {
|
||||
if (mp_obj_is_callable(ui_wait_callback)) {
|
||||
mp_call_function_2(ui_wait_callback, mp_obj_new_int(wait), mp_obj_new_int(progress));
|
||||
if (mp_call_function_2(ui_wait_callback, mp_obj_new_int(wait), mp_obj_new_int(progress)) == mp_const_true) {
|
||||
return sectrue;
|
||||
}
|
||||
}
|
||||
return secfalse;
|
||||
}
|
||||
|
||||
/// def init(ui_wait_callback: (int, int -> None)=None) -> None:
|
||||
|
@ -5,7 +5,7 @@ def pin_to_int(pin: str) -> int:
|
||||
return int("1" + pin)
|
||||
|
||||
|
||||
def show_pin_timeout(seconds: int, progress: int):
|
||||
def show_pin_timeout(seconds: int, progress: int) -> bool:
|
||||
if progress == 0:
|
||||
ui.display.bar(0, 0, ui.WIDTH, ui.HEIGHT, ui.BG)
|
||||
ui.display.text_center(
|
||||
@ -37,3 +37,4 @@ def show_pin_timeout(seconds: int, progress: int):
|
||||
ui.WIDTH,
|
||||
)
|
||||
ui.display.refresh()
|
||||
return False
|
||||
|
2
vendor/trezor-storage
vendored
2
vendor/trezor-storage
vendored
@ -1 +1 @@
|
||||
Subproject commit 8fc03a5a95d3b75b29909a9f030fd74b294bf63b
|
||||
Subproject commit 4429888b9325d200b699a90f7a0e1a07d08f09c0
|
Loading…
Reference in New Issue
Block a user