From 5160c90690c6c3881eec1aa7392d1473c9f865b3 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sun, 20 Mar 2022 13:07:39 +0000 Subject: x1000: bootloader: add screenshot function Screenshots of the recovery menu will be useful for documentation. This can be disabled by turning off HAVE_BOOTLOADER_SCREENDUMP in the target config file if the bootloader should ever run up against max size limits. Change-Id: I62ec1e465df2ca7a8a0e78625d88b31f6c4ef078 --- bootloader/x1000/gui.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'bootloader/x1000/gui.c') diff --git a/bootloader/x1000/gui.c b/bootloader/x1000/gui.c index 513a3cb9cb..1208d3c161 100644 --- a/bootloader/x1000/gui.c +++ b/bootloader/x1000/gui.c @@ -122,10 +122,17 @@ void splashf(long delay, const char* msg, ...) int get_button(int timeout) { int btn = button_get_w_tmo(timeout); - if(btn == SYS_USB_CONNECTED) - is_usb_connected = true; - else if(btn == SYS_USB_DISCONNECTED) - is_usb_connected = false; + switch(btn) { + case SYS_USB_CONNECTED: + case SYS_USB_DISCONNECTED: + is_usb_connected = (btn == SYS_USB_CONNECTED); + break; +#ifdef HAVE_SCREENDUMP + case BL_SCREENSHOT: + screenshot(); + break; +#endif + } return btn; } -- cgit v1.2.3