summaryrefslogtreecommitdiff
path: root/bootloader/iriver_h300.c
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader/iriver_h300.c')
-rw-r--r--bootloader/iriver_h300.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/bootloader/iriver_h300.c b/bootloader/iriver_h300.c
index 286e123d53..4f4baf8cb5 100644
--- a/bootloader/iriver_h300.c
+++ b/bootloader/iriver_h300.c
@@ -89,22 +89,22 @@ void start_firmware(void)
89void shutdown(void) 89void shutdown(void)
90{ 90{
91 printf("Shutting down..."); 91 printf("Shutting down...");
92 92
93 /* We need to gracefully spin down the disk to prevent clicks. */ 93 /* We need to gracefully spin down the disk to prevent clicks. */
94 if (ide_powered()) 94 if (ide_powered())
95 { 95 {
96 /* Make sure ATA has been initialized. */ 96 /* Make sure ATA has been initialized. */
97 storage_init(); 97 storage_init();
98 98
99 /* And put the disk into sleep immediately. */ 99 /* And put the disk into sleep immediately. */
100 storage_sleepnow(); 100 storage_sleepnow();
101 } 101 }
102 102
103 sleep(HZ*2); 103 sleep(HZ*2);
104 104
105 backlight_hw_off(); 105 backlight_hw_off();
106 remote_backlight_hw_off(); 106 remote_backlight_hw_off();
107 107
108 __reset_cookie(); 108 __reset_cookie();
109 power_off(); 109 power_off();
110} 110}
@@ -113,14 +113,14 @@ void shutdown(void)
113void check_battery(void) 113void check_battery(void)
114{ 114{
115 int battery_voltage, batt_int, batt_frac; 115 int battery_voltage, batt_int, batt_frac;
116 116
117 battery_voltage = _battery_voltage(); 117 battery_voltage = _battery_voltage();
118 batt_int = battery_voltage / 1000; 118 batt_int = battery_voltage / 1000;
119 batt_frac = (battery_voltage % 1000) / 10; 119 batt_frac = (battery_voltage % 1000) / 10;
120 120
121 printf("Batt: %d.%02dV", batt_int, batt_frac); 121 printf("Batt: %d.%02dV", batt_int, batt_frac);
122 122
123 if (battery_voltage <= 310) 123 if (battery_voltage <= 310)
124 { 124 {
125 printf("WARNING! BATTERY LOW!!"); 125 printf("WARNING! BATTERY LOW!!");
126 sleep(HZ*2); 126 sleep(HZ*2);
@@ -131,7 +131,7 @@ void check_battery(void)
131extern unsigned char pcf50606_intregs[3]; 131extern unsigned char pcf50606_intregs[3];
132 132
133/* From common.c */ 133/* From common.c */
134extern int line; 134extern int line;
135extern int remote_line; 135extern int remote_line;
136 136
137void main(void) 137void main(void)
@@ -187,7 +187,7 @@ void main(void)
187 /* Start with the main backlight OFF. */ 187 /* Start with the main backlight OFF. */
188 backlight_hw_init(); 188 backlight_hw_init();
189 backlight_hw_off(); 189 backlight_hw_off();
190 190
191 remote_backlight_hw_on(); 191 remote_backlight_hw_on();
192 192
193 system_init(); 193 system_init();
@@ -202,7 +202,7 @@ void main(void)
202 202
203 adc_init(); 203 adc_init();
204 button_init(); 204 button_init();
205 205
206 lcd_init(); 206 lcd_init();
207 lcd_remote_init(); 207 lcd_remote_init();
208 font_init(); 208 font_init();
@@ -222,7 +222,7 @@ void main(void)
222 222
223 if(rtc_alarm) 223 if(rtc_alarm)
224 printf("RTC alarm detected"); 224 printf("RTC alarm detected");
225 225
226 /* Don't start if the Hold button is active on the device you 226 /* Don't start if the Hold button is active on the device you
227 are starting with */ 227 are starting with */
228 if ((on_button && button_hold()) || 228 if ((on_button && button_hold()) ||
@@ -230,7 +230,7 @@ void main(void)
230 { 230 {
231 hold_status = true; 231 hold_status = true;
232 } 232 }
233 if (hold_status && !rtc_alarm && (usb_detect() != USB_INSERTED) && 233 if (hold_status && !rtc_alarm && (usb_detect() != USB_INSERTED) &&
234 !charger_inserted()) 234 !charger_inserted())
235 { 235 {
236 if (detect_original_firmware()) 236 if (detect_original_firmware())
@@ -264,7 +264,7 @@ void main(void)
264 bool request_start = false; 264 bool request_start = false;
265 265
266 cpu_idle_mode(true); 266 cpu_idle_mode(true);
267 267
268 while(charger_inserted() && !request_start) 268 while(charger_inserted() && !request_start)
269 { 269 {
270 button = button_get_w_tmo(HZ); 270 button = button_get_w_tmo(HZ);
@@ -274,7 +274,7 @@ void main(void)
274 case BUTTON_ON: 274 case BUTTON_ON:
275 request_start = true; 275 request_start = true;
276 break; 276 break;
277 277
278 case BUTTON_NONE: /* Timeout */ 278 case BUTTON_NONE: /* Timeout */
279 279
280 if(charging_state()) 280 if(charging_state())
@@ -288,7 +288,7 @@ void main(void)
288 blink_toggle = true; 288 blink_toggle = true;
289 msg = complete_msg; 289 msg = complete_msg;
290 } 290 }
291 291
292 font_getstringsize(msg, &w, &h, FONT_SYSFIXED); 292 font_getstringsize(msg, &w, &h, FONT_SYSFIXED);
293 reset_screen(); 293 reset_screen();
294 if(blink_toggle) 294 if(blink_toggle)
@@ -306,7 +306,7 @@ void main(void)
306 306
307 cpu_idle_mode(false); 307 cpu_idle_mode(false);
308 } 308 }
309 309
310 usb_init(); 310 usb_init();
311 311
312 /* A hack to enter USB mode without using the USB thread */ 312 /* A hack to enter USB mode without using the USB thread */
@@ -333,7 +333,7 @@ void main(void)
333 line = 0; 333 line = 0;
334 remote_line = 0; 334 remote_line = 0;
335 check_battery(); 335 check_battery();
336 336
337 storage_spin(); /* Prevent the drive from spinning down */ 337 storage_spin(); /* Prevent the drive from spinning down */
338 sleep(HZ); 338 sleep(HZ);
339 } 339 }
@@ -408,9 +408,9 @@ unsigned short *bidi_l2v(const unsigned char *str, int orientation)
408 static unsigned short utf16_buf[SCROLL_LINE_SIZE]; 408 static unsigned short utf16_buf[SCROLL_LINE_SIZE];
409 unsigned short *target; 409 unsigned short *target;
410 (void)orientation; 410 (void)orientation;
411 411
412 target = utf16_buf; 412 target = utf16_buf;
413 413
414 while (*str) 414 while (*str)
415 str = utf8decode(str, target++); 415 str = utf8decode(str, target++);
416 *target = 0; 416 *target = 0;