summaryrefslogtreecommitdiff
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r--apps/debug_menu.c18
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: