dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Question to powermgm.c charging algorithm
From: Uwe Freese (
Date: 2002-08-08


First: What do you call negative and positive delta? It seems that

positive delta = voltage is going down
negative delta = voltage is going up

Now a question to the code:

   if (delta < -50) { /* delta < -0.3 V */
          DEBUGF("power: short-term negative delta, enough!\n");
          snprintf(power_message, POWER_MESSAGE_LEN, "end negd %d %dmin", delta, charged_time);
   } else {
          /* if we didn't disable the charger in the previous test, check for low positive delta */
          delta = 0;
          for (i = 0; i < CHARGE_END_ZEROD; i++)
              delta += power_history[POWER_HISTORY_LEN-1-i]*100 - power_history[POWER_HISTORY_LEN-1-i-1]*100;
          delta = delta / CHARGE_END_ZEROD;
          if (delta <= 5) { /* delta of <= 0.005 V */
               DEBUGF("power: long-term small positive delta, enough!\n");
               snprintf(power_message, POWER_MESSAGE_LEN, "end lowd %d %dmin", delta, charged_time);

why is the second test (delta <= 5) ? Shouldn't it be (delta >= 5), that
means "turn off charging if the voltage went down at least by
0.005" Volts?

Does the first check (delta < -50) mean that charging stops if the
voltage went up very quickly?

Bye, Uwe.

Page was last modified "Jan 10 2012" The Rockbox Crew