diff options
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r-- | apps/debug_menu.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 2ab2194199..3969972ea8 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -825,6 +825,8 @@ bool dbg_ports(void) | |||
825 | char buf[128]; | 825 | char buf[128]; |
826 | int button; | 826 | int button; |
827 | int line; | 827 | int line; |
828 | int battery_voltage; | ||
829 | int batt_int, batt_frac; | ||
828 | 830 | ||
829 | #ifdef HAVE_LCD_BITMAP | 831 | #ifdef HAVE_LCD_BITMAP |
830 | lcd_setmargins(0, 0); | 832 | lcd_setmargins(0, 0); |
@@ -873,6 +875,14 @@ bool dbg_ports(void) | |||
873 | snprintf(buf, sizeof(buf), "ADC_BATTERY: %02x", adc_battery); | 875 | snprintf(buf, sizeof(buf), "ADC_BATTERY: %02x", adc_battery); |
874 | lcd_puts(0, line++, buf); | 876 | lcd_puts(0, line++, buf); |
875 | 877 | ||
878 | battery_voltage = (adc_battery * BATTERY_SCALE_FACTOR) / 10000; | ||
879 | batt_int = battery_voltage / 100; | ||
880 | batt_frac = battery_voltage % 100; | ||
881 | |||
882 | snprintf(buf, 32, "Batt: %d.%02dV %d%% ", batt_int, batt_frac, | ||
883 | battery_level()); | ||
884 | lcd_puts(0, line++, buf); | ||
885 | |||
876 | lcd_update(); | 886 | lcd_update(); |
877 | button = button_get_w_tmo(HZ/10); | 887 | button = button_get_w_tmo(HZ/10); |
878 | 888 | ||