diff options
Diffstat (limited to 'bootloader/x1000.c')
-rw-r--r-- | bootloader/x1000.c | 82 |
1 files changed, 1 insertions, 81 deletions
diff --git a/bootloader/x1000.c b/bootloader/x1000.c index 78b74452d9..a079c478d5 100644 --- a/bootloader/x1000.c +++ b/bootloader/x1000.c | |||
@@ -67,13 +67,6 @@ struct menuitem { | |||
67 | void(*action)(void); | 67 | void(*action)(void); |
68 | }; | 68 | }; |
69 | 69 | ||
70 | void clearscreen(void); | ||
71 | void putversion(void); | ||
72 | void putcenter_y(int y, const char* msg); | ||
73 | void putcenter_line(int line, const char* msg); | ||
74 | void splash2(long delay, const char* msg, const char* msg2); | ||
75 | void splash(long delay, const char* msg); | ||
76 | |||
77 | void init_lcd(void); | 70 | void init_lcd(void); |
78 | void init_usb(void); | 71 | void init_usb(void); |
79 | int init_disk(void); | 72 | int init_disk(void); |
@@ -102,7 +95,6 @@ const struct menuitem recovery_items[] = { | |||
102 | }; | 95 | }; |
103 | 96 | ||
104 | /* Flags to indicate if hardware was already initialized */ | 97 | /* Flags to indicate if hardware was already initialized */ |
105 | bool lcd_inited = false; | ||
106 | bool usb_inited = false; | 98 | bool usb_inited = false; |
107 | bool disk_inited = false; | 99 | bool disk_inited = false; |
108 | 100 | ||
@@ -110,77 +102,6 @@ bool disk_inited = false; | |||
110 | * Set to false if a SYS_USB_DISCONNECTED event is seen */ | 102 | * Set to false if a SYS_USB_DISCONNECTED event is seen */ |
111 | bool is_usb_connected = false; | 103 | bool is_usb_connected = false; |
112 | 104 | ||
113 | void clearscreen(void) | ||
114 | { | ||
115 | init_lcd(); | ||
116 | lcd_clear_display(); | ||
117 | putversion(); | ||
118 | } | ||
119 | |||
120 | void putversion(void) | ||
121 | { | ||
122 | int x = (LCD_WIDTH - SYSFONT_WIDTH*strlen(rbversion)) / 2; | ||
123 | int y = LCD_HEIGHT - SYSFONT_HEIGHT; | ||
124 | lcd_putsxy(x, y, rbversion); | ||
125 | } | ||
126 | |||
127 | void putcenter_y(int y, const char* msg) | ||
128 | { | ||
129 | int x = (LCD_WIDTH - SYSFONT_WIDTH*strlen(msg)) / 2; | ||
130 | lcd_putsxy(x, y, msg); | ||
131 | } | ||
132 | |||
133 | void putcenter_line(int line, const char* msg) | ||
134 | { | ||
135 | int y = LCD_HEIGHT/2 + (line - 1)*SYSFONT_HEIGHT; | ||
136 | putcenter_y(y, msg); | ||
137 | } | ||
138 | |||
139 | void splash2(long delay, const char* msg, const char* msg2) | ||
140 | { | ||
141 | clearscreen(); | ||
142 | putcenter_line(0, msg); | ||
143 | if(msg2) | ||
144 | putcenter_line(1, msg2); | ||
145 | lcd_update(); | ||
146 | sleep(delay); | ||
147 | } | ||
148 | |||
149 | void splash(long delay, const char* msg) | ||
150 | { | ||
151 | splash2(delay, msg, NULL); | ||
152 | } | ||
153 | |||
154 | int get_button(int timeout) | ||
155 | { | ||
156 | int btn = button_get_w_tmo(timeout); | ||
157 | if(btn == SYS_USB_CONNECTED) | ||
158 | is_usb_connected = true; | ||
159 | else if(btn == SYS_USB_DISCONNECTED) | ||
160 | is_usb_connected = false; | ||
161 | |||
162 | return btn; | ||
163 | } | ||
164 | |||
165 | void init_lcd(void) | ||
166 | { | ||
167 | if(lcd_inited) | ||
168 | return; | ||
169 | |||
170 | lcd_init(); | ||
171 | font_init(); | ||
172 | lcd_setfont(FONT_SYSFIXED); | ||
173 | |||
174 | /* Clear screen before turning backlight on, otherwise we might | ||
175 | * display random garbage on the screen */ | ||
176 | lcd_clear_display(); | ||
177 | lcd_update(); | ||
178 | |||
179 | backlight_init(); | ||
180 | |||
181 | lcd_inited = true; | ||
182 | } | ||
183 | |||
184 | void init_usb(void) | 105 | void init_usb(void) |
185 | { | 106 | { |
186 | if(usb_inited) | 107 | if(usb_inited) |
@@ -314,8 +235,7 @@ void boot_rockbox(void) | |||
314 | return; | 235 | return; |
315 | } | 236 | } |
316 | 237 | ||
317 | if(lcd_inited) | 238 | gui_shutdown(); |
318 | backlight_hw_off(); | ||
319 | 239 | ||
320 | x1000_boot_rockbox(loadbuffer, rc); | 240 | x1000_boot_rockbox(loadbuffer, rc); |
321 | } | 241 | } |