From 6bc69c797c71200046fdb7bd3afd429d1db48d2f Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sun, 20 Mar 2022 13:13:54 +0000 Subject: x1000: bootloader: accept button input during splash This allows screenshots to be taken while a splash is displayed. Change-Id: Id494189283db1b6877416f5a1ef1a13c8b654507 --- bootloader/x1000/gui.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'bootloader/x1000/gui.c') diff --git a/bootloader/x1000/gui.c b/bootloader/x1000/gui.c index 1208d3c161..a15f315a44 100644 --- a/bootloader/x1000/gui.c +++ b/bootloader/x1000/gui.c @@ -116,7 +116,15 @@ void splashf(long delay, const char* msg, ...) } while(str); lcd_update(); - sleep(delay); + + if(delay == TIMEOUT_BLOCK) { + while(get_button(TIMEOUT_BLOCK) != BL_QUIT); + } else if(delay > 0) { + long end_tick = current_tick + delay; + do { + get_button(end_tick - current_tick); + } while(current_tick < end_tick); + } } int get_button(int timeout) -- cgit v1.2.3