diff options
Diffstat (limited to 'apps/main_menu.c')
-rw-r--r-- | apps/main_menu.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/apps/main_menu.c b/apps/main_menu.c index 7ae57f1c7b..21e8c091b6 100644 --- a/apps/main_menu.c +++ b/apps/main_menu.c | |||
@@ -137,7 +137,7 @@ extern bool simulate_usb(void); | |||
137 | #endif | 137 | #endif |
138 | bool show_info(void) | 138 | bool show_info(void) |
139 | { | 139 | { |
140 | char s[32]; | 140 | char s[32], s2[32]; |
141 | /* avoid overflow for 8MB mod :) was: ((mp3end - mp3buf) * 1000) / 0x100000; */ | 141 | /* avoid overflow for 8MB mod :) was: ((mp3end - mp3buf) * 1000) / 0x100000; */ |
142 | int buflen = ((mp3end - mp3buf) * 100) / 0x19999; | 142 | int buflen = ((mp3end - mp3buf) * 100) / 0x19999; |
143 | int integer, decimal; | 143 | int integer, decimal; |
@@ -146,9 +146,13 @@ bool show_info(void) | |||
146 | int state = 1; | 146 | int state = 1; |
147 | unsigned long size, free; | 147 | unsigned long size, free; |
148 | 148 | ||
149 | const unsigned char *kbyte_units[] = { | ||
150 | ID2P(LANG_KILOBYTE), | ||
151 | ID2P(LANG_MEGABYTE), | ||
152 | ID2P(LANG_GIGABYTE) | ||
153 | }; | ||
154 | |||
149 | fat_size( IF_MV2(0,) &size, &free ); | 155 | fat_size( IF_MV2(0,) &size, &free ); |
150 | size /= 1024; | ||
151 | free /= 1024; | ||
152 | 156 | ||
153 | if (global_settings.talk_menu) | 157 | if (global_settings.talk_menu) |
154 | { /* say whatever is reasonable, no real connection to the screen */ | 158 | { /* say whatever is reasonable, no real connection to the screen */ |
@@ -160,11 +164,8 @@ bool show_info(void) | |||
160 | talk_value(battery_level(), UNIT_PERCENT, true); | 164 | talk_value(battery_level(), UNIT_PERCENT, true); |
161 | } | 165 | } |
162 | 166 | ||
163 | talk_id(LANG_DISK_FREE_STAT, enqueue); | 167 | talk_id(LANG_DISK_FREE_INFO, enqueue); |
164 | talk_number(free / 1024, true); | 168 | output_dyn_value(NULL, 0, free, kbyte_units, true); /* NULL == talk */ |
165 | decimal = free % 1024 / 100; | ||
166 | talk_id(VOICE_POINT, true); | ||
167 | talk_value(decimal, UNIT_GB, true); | ||
168 | 169 | ||
169 | #ifdef HAVE_RTC | 170 | #ifdef HAVE_RTC |
170 | { | 171 | { |
@@ -220,14 +221,12 @@ bool show_info(void) | |||
220 | } | 221 | } |
221 | 222 | ||
222 | if (state & 2) { | 223 | if (state & 2) { |
223 | integer = size / 1024; | 224 | output_dyn_value(s2, sizeof s2, size, kbyte_units, true); |
224 | decimal = size % 1024 / 100; | 225 | snprintf(s, sizeof s, "%s %s", str(LANG_DISK_SIZE_INFO), s2); |
225 | snprintf(s, sizeof s, str(LANG_DISK_STAT), integer, decimal); | ||
226 | lcd_puts(0, y++, s); | 226 | lcd_puts(0, y++, s); |
227 | 227 | ||
228 | integer = free / 1024; | 228 | output_dyn_value(s2, sizeof s2, free, kbyte_units, true); |
229 | decimal = free % 1024 / 100; | 229 | snprintf(s, sizeof s, "%s %s", str(LANG_DISK_FREE_INFO), s2); |
230 | snprintf(s, sizeof s, str(LANG_DISK_FREE_STAT), integer, decimal); | ||
231 | lcd_puts(0, y++, s); | 230 | lcd_puts(0, y++, s); |
232 | } | 231 | } |
233 | lcd_update(); | 232 | lcd_update(); |