summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-12-11 16:18:30 +0000
committerAidan MacDonald <amachronic@protonmail.com>2021-12-23 11:40:22 +0000
commit22d0c4da7085610136939ffe82bb3877a4fd8d5b (patch)
treef45d267c37796e83c73449fa4708e219e193bb16 /apps
parent1a313dc9bff109d155e35bac79c475ea65198aea (diff)
downloadrockbox-22d0c4da7085610136939ffe82bb3877a4fd8d5b.tar.gz
rockbox-22d0c4da7085610136939ffe82bb3877a4fd8d5b.zip
Revert "powermgmt: Remove an unnecessary function"
This reverts commit 6ff1a935b923b69d34d18e68af612297912c806b. Reason: it created a mismatch between the displayed voltage and percent since the voltage was unfiltered but percentage was based off the filtered voltage. Change-Id: I4cba099f2e1edf0ef7c4e17a32f566aa66f5b933
Diffstat (limited to 'apps')
-rw-r--r--apps/debug_menu.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index b11458fef8..3a9218bc84 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -849,7 +849,7 @@ static bool tsc2100_debug(void)
849static bool view_battery(void) 849static bool view_battery(void)
850{ 850{
851 int view = 0; 851 int view = 0;
852 int i, x, y, y1, y2, grid, graph; 852 int i, x, y, z, y1, y2, grid, graph;
853 unsigned short maxv, minv; 853 unsigned short maxv, minv;
854 854
855 lcd_setfont(FONT_SYSFIXED); 855 lcd_setfont(FONT_SYSFIXED);
@@ -944,12 +944,11 @@ static bool view_battery(void)
944#else 944#else
945 lcd_puts(0, 0, "Power status: unknown"); 945 lcd_puts(0, 0, "Power status: unknown");
946#endif 946#endif
947 947 battery_read_info(&y, &z);
948 y = _battery_voltage();
949 if (y > 0) 948 if (y > 0)
950 lcd_putsf(0, 1, "Battery: %d.%03d V (%d %%)", y / 1000, y % 1000, battery_level()); 949 lcd_putsf(0, 1, "Battery: %d.%03d V (%d %%)", y / 1000, y % 1000, z);
951 else 950 else if (z > 0)
952 lcd_putsf(0, 1, "Battery: %d %%", _battery_level()); 951 lcd_putsf(0, 1, "Battery: %d %%", z);
953#ifdef ADC_EXT_POWER 952#ifdef ADC_EXT_POWER
954 y = (adc_read(ADC_EXT_POWER) * EXT_SCALE_FACTOR) / 1000; 953 y = (adc_read(ADC_EXT_POWER) * EXT_SCALE_FACTOR) / 1000;
955 lcd_putsf(0, 2, "External: %d.%03d V", y / 1000, y % 1000); 954 lcd_putsf(0, 2, "External: %d.%03d V", y / 1000, y % 1000);