summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-11-30 00:06:33 +0000
committerAidan MacDonald <amachronic@protonmail.com>2021-12-05 14:18:32 -0500
commit6ff1a935b923b69d34d18e68af612297912c806b (patch)
tree6026d07765d9235118c039ce2afa4d5560d29950 /apps
parentd93a3cac50d966227e9c9d77391bf47b2a858fb1 (diff)
downloadrockbox-6ff1a935b923b69d34d18e68af612297912c806b.tar.gz
rockbox-6ff1a935b923b69d34d18e68af612297912c806b.zip
powermgmt: Remove an unnecessary function
Remove battery_read_info() which is a simple wrapper function only used by debug screens. Use the polling functions directly to save a bit of code size. Change-Id: I2919f78105bab186f6933dc1823f9fa67fe74f3e
Diffstat (limited to 'apps')
-rw-r--r--apps/debug_menu.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 1b93278b0d..4c0486595f 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -849,7 +849,7 @@ static bool tsc2100_debug(void)
static bool view_battery(void)
{
int view = 0;
- int i, x, y, z, y1, y2, grid, graph;
+ int i, x, y, y1, y2, grid, graph;
unsigned short maxv, minv;
lcd_setfont(FONT_SYSFIXED);
@@ -944,11 +944,12 @@ static bool view_battery(void)
#else
lcd_puts(0, 0, "Power status: unknown");
#endif
- battery_read_info(&y, &z);
+
+ y = _battery_voltage();
if (y > 0)
- lcd_putsf(0, 1, "Battery: %d.%03d V (%d %%)", y / 1000, y % 1000, z);
- else if (z > 0)
- lcd_putsf(0, 1, "Battery: %d %%", z);
+ lcd_putsf(0, 1, "Battery: %d.%03d V (%d %%)", y / 1000, y % 1000, battery_level());
+ else
+ lcd_putsf(0, 1, "Battery: %d %%", _battery_level());
#ifdef ADC_EXT_POWER
y = (adc_read(ADC_EXT_POWER) * EXT_SCALE_FACTOR) / 1000;
lcd_putsf(0, 2, "External: %d.%03d V", y / 1000, y % 1000);