summaryrefslogtreecommitdiff
path: root/bootloader/x1000/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader/x1000/utils.c')
-rw-r--r--bootloader/x1000/utils.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/bootloader/x1000/utils.c b/bootloader/x1000/utils.c
index 629a2c6280..4d3fb69e57 100644
--- a/bootloader/x1000/utils.c
+++ b/bootloader/x1000/utils.c
@@ -29,6 +29,7 @@
29#include "rb-loader.h" 29#include "rb-loader.h"
30#include "loader_strerror.h" 30#include "loader_strerror.h"
31#include "linuxboot.h" 31#include "linuxboot.h"
32#include "screendump.h"
32#include "nand-x1000.h" 33#include "nand-x1000.h"
33 34
34/* Set to true if a SYS_USB_CONNECTED event is seen 35/* Set to true if a SYS_USB_CONNECTED event is seen
@@ -37,6 +38,8 @@
37 * TODO: this is an ugly kludge */ 38 * TODO: this is an ugly kludge */
38bool is_usb_connected = false; 39bool is_usb_connected = false;
39 40
41static bool screenshot_enabled = false;
42
40/* this is both incorrect and incredibly racy... */ 43/* this is both incorrect and incredibly racy... */
41int check_disk(bool wait) 44int check_disk(bool wait)
42{ 45{
@@ -75,6 +78,25 @@ void usb_mode(void)
75 splashf(3*HZ, "USB disconnected"); 78 splashf(3*HZ, "USB disconnected");
76} 79}
77 80
81void screenshot(void)
82{
83#ifdef HAVE_SCREENDUMP
84 if(!screenshot_enabled || check_disk(false) != DISK_PRESENT)
85 return;
86
87 screen_dump();
88#endif
89}
90
91void screenshot_enable(void)
92{
93#ifdef HAVE_SCREENDUMP
94 splashf(3*HZ, "Screenshots enabled\nPress %s for screenshot",
95 BL_SCREENSHOT_NAME);
96 screenshot_enabled = true;
97#endif
98}
99
78int load_rockbox(const char* filename, size_t* sizep) 100int load_rockbox(const char* filename, size_t* sizep)
79{ 101{
80 if(check_disk(true) != DISK_PRESENT) 102 if(check_disk(true) != DISK_PRESENT)