diff options
Diffstat (limited to 'flash/bootbox')
-rw-r--r-- | flash/bootbox/main.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/flash/bootbox/main.c b/flash/bootbox/main.c index 4f5efdd7c6..af822b4a64 100644 --- a/flash/bootbox/main.c +++ b/flash/bootbox/main.c | |||
@@ -99,21 +99,16 @@ void charging_screen(void) | |||
99 | lcd_puts(0, 0, msg); | 99 | lcd_puts(0, 0, msg); |
100 | { | 100 | { |
101 | char buf[32]; | 101 | char buf[32]; |
102 | int battery_voltage; | 102 | int battv = battery_voltage(); |
103 | int batt_int, batt_frac; | ||
104 | battery_voltage = (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) / 10000; | ||
105 | batt_int = battery_voltage / 100; | ||
106 | batt_frac = battery_voltage % 100; | ||
107 | |||
108 | snprintf(buf, sizeof(buf), "%d.%02dV %d%%", | 103 | snprintf(buf, sizeof(buf), "%d.%02dV %d%%", |
109 | batt_int, batt_frac, battery_level()); | 104 | battv / 100, battv % 100, battery_level()); |
110 | lcd_puts(0, 1, buf); | 105 | lcd_puts(0, 1, buf); |
111 | } | 106 | } |
112 | 107 | ||
113 | #ifdef HAVE_LCD_BITMAP | 108 | #ifdef HAVE_LCD_BITMAP |
114 | lcd_update(); | 109 | lcd_update(); |
115 | #endif | 110 | #endif |
116 | 111 | ||
117 | button = button_get_w_tmo(HZ/2); | 112 | button = button_get_w_tmo(HZ/2); |
118 | #ifdef BUTTON_ON | 113 | #ifdef BUTTON_ON |
119 | if (button == (BUTTON_ON | BUTTON_REL)) | 114 | if (button == (BUTTON_ON | BUTTON_REL)) |
@@ -144,7 +139,7 @@ void prompt_usb(const char* msg1, const char* msg2) | |||
144 | lcd_puts(0, 3, "and fix it."); | 139 | lcd_puts(0, 3, "and fix it."); |
145 | lcd_update(); | 140 | lcd_update(); |
146 | #endif | 141 | #endif |
147 | do | 142 | do |
148 | { | 143 | { |
149 | button = button_get(true); | 144 | button = button_get(true); |
150 | if (button == SYS_POWEROFF) | 145 | if (button == SYS_POWEROFF) |
@@ -215,7 +210,7 @@ void main(void) | |||
215 | } | 210 | } |
216 | 211 | ||
217 | { // rolo the firmware | 212 | { // rolo the firmware |
218 | static const char filename[] = "/" BOOTFILE; | 213 | static const char filename[] = "/" BOOTFILE; |
219 | rolo_load((char*)filename); /* won't return if started */ | 214 | rolo_load((char*)filename); /* won't return if started */ |
220 | 215 | ||
221 | prompt_usb("No firmware", filename); | 216 | prompt_usb("No firmware", filename); |