From d061b371d6f53e0c2f310f4eb5776430772a8ac5 Mon Sep 17 00:00:00 2001 From: Jörg Hohensohn Date: Thu, 3 Mar 2005 08:32:55 +0000 Subject: removed the practically useless "trickle charge" and "deep discharge" options, now trickle is always on and deep always off git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6107 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/powermgmt.h | 6 +----- firmware/powermgmt.c | 33 ++++++--------------------------- 2 files changed, 7 insertions(+), 32 deletions(-) (limited to 'firmware') diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h index 59f9465d49..3bccb0f59f 100644 --- a/firmware/export/powermgmt.h +++ b/firmware/export/powermgmt.h @@ -61,9 +61,8 @@ #define CHARGE_MAX_TIME_1500 450 /* minutes: maximum charging time for 1500 mAh batteries */ /* actual max time depends also on BATTERY_CAPACITY! */ #define CHARGE_MIN_TIME 10 /* minutes: minimum charging time */ -#define CHARGE_RESTART_HI 85 /* %: when to restart charging in 'charge' mode */ +#define CHARGE_RESTART 85 /* %: when to restart charging in 'charge' mode */ /* attention: if set too high, normal charging is started in trickle mode */ -#define CHARGE_RESTART_LO 10 /* %: when to restart charging in 'discharge' mode */ #define TOPOFF_MAX_TIME 90 /* After charging, go to top off charge. How long should top off charge be? */ #define TOPOFF_VOLTAGE 565 /* which voltage is best? (centivolts) */ #define TRICKLE_MAX_TIME 12*60 /* After top off charge, go to trickle charge. How long should trickle charge be? */ @@ -80,9 +79,6 @@ extern int short_delta; /* short term delta battery voltage */ extern int powermgmt_last_cycle_startstop_min; /* how many minutes ago was the charging started or stopped? */ extern int powermgmt_last_cycle_level; /* which level had the batteries at this time? */ -void enable_deep_discharge(bool on); /* deep discharge the battery */ - -void enable_trickle_charge(bool on); extern int trickle_sec; /* trickle charge: How many seconds per minute are we charging actually? */ #endif /* HAVE_CHARGE_CTRL */ diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index 0db2f03a7b..f1bcc541b1 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c @@ -145,7 +145,6 @@ int short_delta; /* short term delta battery voltage */ char power_message[POWER_MESSAGE_LEN] = ""; /* message that's shown in debug menu */ -static char charge_restart_level = CHARGE_RESTART_HI; /* percentage at which charging starts */ int powermgmt_last_cycle_startstop_min = 0; /* how many minutes ago was the @@ -153,7 +152,6 @@ int powermgmt_last_cycle_startstop_min = 0; /* how many minutes ago was the stopped? */ int powermgmt_last_cycle_level = 0; /* which level had the batteries at this time? */ -bool trickle_charge_enabled = true; int trickle_sec = 0; /* how many seconds should the charger be enabled per minute for trickle @@ -194,19 +192,6 @@ int powermgmt_est_runningtime_min = -1; static bool sleeptimer_active = false; static unsigned long sleeptimer_endtick; -#ifdef HAVE_CHARGE_CTRL - -void enable_deep_discharge(bool on) -{ - charge_restart_level = on ? CHARGE_RESTART_LO : CHARGE_RESTART_HI; -} - -void enable_trickle_charge(bool on) -{ - trickle_charge_enabled = on; -} -#endif /* HAVE_CHARGE_CTRL */ - #if BATTERY_TYPES_COUNT > 1 void set_battery_type(int type) { @@ -522,7 +507,6 @@ static void power_thread_sleep(int ticks) { int small_ticks; #ifdef HAVE_CHARGING - unsigned int tmp; bool charger_plugged; #endif @@ -659,14 +643,14 @@ static void power_thread(void) * the charger must have just been plugged in. * 2) If our battery level falls below the restart level, charge! */ - if (((charge_state == DISCHARGING) && trickle_charge_enabled) || - (battery_level() < charge_restart_level)) { + if ((charge_state == DISCHARGING) || + (battery_level() < CHARGE_RESTART)) { /* * If the battery level is nearly charged, just trickle. * If the battery is in between, top-off and then trickle. */ - if(battery_percent > charge_restart_level) { + if(battery_percent > CHARGE_RESTART) { powermgmt_last_cycle_level = battery_percent; powermgmt_last_cycle_startstop_min = 0; if(battery_percent >= 95) { @@ -772,14 +756,9 @@ static void power_thread(void) charge time. For trickle charging, we use 0.05C */ powermgmt_last_cycle_level = battery_percent; powermgmt_last_cycle_startstop_min = 0; - if (trickle_charge_enabled) { - trickle_sec = START_TRICKLE_SEC; - charge_state = TRICKLE; - } else { - /* If we don't trickle charge, we discharge */ - trickle_sec = 0; /* off */ - charge_state = DISCHARGING; - } + + trickle_sec = START_TRICKLE_SEC; + charge_state = TRICKLE; } } else if (charge_state > CHARGING) /* top off or trickle */ -- cgit v1.2.3