diff options
| author | Heikki Hannikainen <hessuh@rockbox.org> | 2002-08-12 12:21:22 +0000 |
|---|---|---|
| committer | Heikki Hannikainen <hessuh@rockbox.org> | 2002-08-12 12:21:22 +0000 |
| commit | cccb8d0a644e40e03665ab68342fc73296a0f7a4 (patch) | |
| tree | ac73cdaa0402599e856eba32c4c28adea2917be9 /apps/debug_menu.c | |
| parent | a4cb4aff7ba5546183e221687830f4d72abb8512 (diff) | |
| download | rockbox-cccb8d0a644e40e03665ab68342fc73296a0f7a4.zip rockbox-cccb8d0a644e40e03665ab68342fc73296a0f7a4.tar.gz rockbox-cccb8d0a644e40e03665ab68342fc73296a0f7a4.tar.bz2 rockbox-cccb8d0a644e40e03665ab68342fc73296a0f7a4.tar.xz | |
Sync the charger debug view of deltas with the charger code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1683 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/debug_menu.c')
| -rw-r--r-- | apps/debug_menu.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 0a2e4be..cc1ca2c 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -506,20 +506,16 @@ void view_battery(void) charger_enabled ? "yes" : "no"); lcd_puts(0, 4, buf); #endif - y = 0; - for (i = 0; i < CHARGE_END_NEGD; i++) - y += power_history[POWER_HISTORY_LEN-1-i]*100 - - power_history[POWER_HISTORY_LEN-1-i-1]*100; - y = y / CHARGE_END_NEGD; + y = ( power_history[POWER_HISTORY_LEN-1] * 100 + - power_history[POWER_HISTORY_LEN-1-CHARGE_END_NEGD] * 100 ) + / CHARGE_END_NEGD; snprintf(buf, 30, "short delta: %d", y); lcd_puts(0, 5, buf); - y = 0; - for (i = 0; i < CHARGE_END_ZEROD; i++) - y += power_history[POWER_HISTORY_LEN-1-i]*100 - - power_history[POWER_HISTORY_LEN-1-i-1]*100; - y = y / CHARGE_END_ZEROD; + y = ( power_history[POWER_HISTORY_LEN-1] * 100 + - power_history[POWER_HISTORY_LEN-1-CHARGE_END_ZEROD] * 100 ) + / CHARGE_END_ZEROD; snprintf(buf, 30, "long delta: %d", y); lcd_puts(0, 6, buf); @@ -546,7 +542,7 @@ void view_battery(void) lcd_update(); sleep(HZ/2); - + switch(button_get(false)) { case BUTTON_UP: |