forked from len0rd/rockbox
Revert "powermgmt: Remove an unnecessary function"
This reverts commit 6ff1a935b9.
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
This commit is contained in:
parent
1a313dc9bf
commit
22d0c4da70
4 changed files with 29 additions and 9 deletions
|
|
@ -849,7 +849,7 @@ static bool tsc2100_debug(void)
|
|||
static bool view_battery(void)
|
||||
{
|
||||
int view = 0;
|
||||
int i, x, y, y1, y2, grid, graph;
|
||||
int i, x, y, z, y1, y2, grid, graph;
|
||||
unsigned short maxv, minv;
|
||||
|
||||
lcd_setfont(FONT_SYSFIXED);
|
||||
|
|
@ -944,12 +944,11 @@ static bool view_battery(void)
|
|||
#else
|
||||
lcd_puts(0, 0, "Power status: unknown");
|
||||
#endif
|
||||
|
||||
y = _battery_voltage();
|
||||
battery_read_info(&y, &z);
|
||||
if (y > 0)
|
||||
lcd_putsf(0, 1, "Battery: %d.%03d V (%d %%)", y / 1000, y % 1000, battery_level());
|
||||
else
|
||||
lcd_putsf(0, 1, "Battery: %d %%", _battery_level());
|
||||
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);
|
||||
#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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue