1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 07:28:10 +00:00

modtrezorconfig: Chenge ui_wait_callback() to return secbool.

This commit is contained in:
andrew 2019-02-07 12:01:08 +01:00 committed by Pavol Rusnak
parent c106e81a05
commit 36f354714d
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
3 changed files with 8 additions and 4 deletions

View File

@ -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:

View File

@ -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

@ -1 +1 @@
Subproject commit 8fc03a5a95d3b75b29909a9f030fd74b294bf63b
Subproject commit 4429888b9325d200b699a90f7a0e1a07d08f09c0