diff options
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/main_menu.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/main_menu.c b/apps/main_menu.c index 09da232..db70d0f 100644 --- a/apps/main_menu.c +++ b/apps/main_menu.c @@ -189,8 +189,11 @@ bool show_info(void) snprintf(s, sizeof(s), str(LANG_BATTERY_TRICKLE_CHARGE)); else #endif - snprintf(s, sizeof(s), str(LANG_BATTERY_TIME), battery_level(), - battery_time() / 60, battery_time() % 60); + if (battery_level() >= 0) + snprintf(s, sizeof(s), str(LANG_BATTERY_TIME), battery_level(), + battery_time() / 60, battery_time() % 60); + else + strncpy(s, "(n/a)", sizeof(s)); lcd_puts(0, y++, s); } |