diff options
Diffstat (limited to 'bootloader/x1000/utils.c')
-rw-r--r-- | bootloader/x1000/utils.c | 22 |
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 */ |
38 | bool is_usb_connected = false; | 39 | bool is_usb_connected = false; |
39 | 40 | ||
41 | static bool screenshot_enabled = false; | ||
42 | |||
40 | /* this is both incorrect and incredibly racy... */ | 43 | /* this is both incorrect and incredibly racy... */ |
41 | int check_disk(bool wait) | 44 | int 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 | ||
81 | void 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 | |||
91 | void 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 | |||
78 | int load_rockbox(const char* filename, size_t* sizep) | 100 | int load_rockbox(const char* filename, size_t* sizep) |
79 | { | 101 | { |
80 | if(check_disk(true) != DISK_PRESENT) | 102 | if(check_disk(true) != DISK_PRESENT) |