diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-03-20 13:07:39 +0000 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-03-25 21:36:51 +0000 |
commit | 5160c90690c6c3881eec1aa7392d1473c9f865b3 (patch) | |
tree | 14acd9467c4d9bbb90c91c864fa8f2323987a6c9 /bootloader/x1000/gui.c | |
parent | 4cf36dfbf37edeb3f537296bb532008b8f206455 (diff) | |
download | rockbox-5160c90690c6c3881eec1aa7392d1473c9f865b3.tar.gz rockbox-5160c90690c6c3881eec1aa7392d1473c9f865b3.zip |
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
Diffstat (limited to 'bootloader/x1000/gui.c')
-rw-r--r-- | bootloader/x1000/gui.c | 15 |
1 files changed, 11 insertions, 4 deletions
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, ...) | |||
122 | int get_button(int timeout) | 122 | int get_button(int timeout) |
123 | { | 123 | { |
124 | int btn = button_get_w_tmo(timeout); | 124 | int btn = button_get_w_tmo(timeout); |
125 | if(btn == SYS_USB_CONNECTED) | 125 | switch(btn) { |
126 | is_usb_connected = true; | 126 | case SYS_USB_CONNECTED: |
127 | else if(btn == SYS_USB_DISCONNECTED) | 127 | case SYS_USB_DISCONNECTED: |
128 | is_usb_connected = false; | 128 | is_usb_connected = (btn == SYS_USB_CONNECTED); |
129 | break; | ||
130 | #ifdef HAVE_SCREENDUMP | ||
131 | case BL_SCREENSHOT: | ||
132 | screenshot(); | ||
133 | break; | ||
134 | #endif | ||
135 | } | ||
129 | 136 | ||
130 | return btn; | 137 | return btn; |
131 | } | 138 | } |