From 43079ea07f13a7631cd3c0e5993638235427a476 Mon Sep 17 00:00:00 2001 From: Jörg Hohensohn Date: Fri, 8 Oct 2004 17:45:52 +0000 Subject: multiple battery types prepared (CONFIG_BATTERY) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5227 a1c6a512-1295-4272-9138-f99709370657 --- firmware/powermgmt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'firmware/powermgmt.c') diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index 155d11e609..e7486635d0 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c @@ -92,7 +92,7 @@ static const int poweroff_idle_timeout_value[15] = static const int percent_to_volt_decharge[11] = /* voltages (centivolt) of 0%, 10%, ... 100% when charging disabled */ { -#ifdef HAVE_LIION +#if CONFIG_BATTERY == BATT_LIION2200 /* measured values */ 260, 285, 295, 303, 311, 320, 330, 345, 360, 380, 400 #else /* NiMH */ @@ -112,7 +112,7 @@ void set_battery_capacity(int capacity) battery_capacity = 1500; } -#if defined(HAVE_CHARGE_CTRL) || defined(HAVE_LIION) +#if defined(HAVE_CHARGE_CTRL) || CONFIG_BATTERY == BATT_LIION2200 int charge_state = 0; /* at the beginning, the charger does nothing */ #endif @@ -443,7 +443,7 @@ static void power_thread(void) int i; int avg, ok_samples, spin_samples; int current = 0; -#ifdef HAVE_LIION +#if CONFIG_BATTERY == BATT_LIION2200 int charging_current; #endif #ifdef HAVE_CHARGE_CTRL @@ -535,7 +535,7 @@ static void power_thread(void) #endif /* MEM == 8 */ #endif /* HAVE_CHARGE_CONTROL */ -#ifdef HAVE_LIION +#if CONFIG_BATTERY == BATT_LIION2200 /* We use the information from the ADC_EXT_POWER ADC channel, which tells us the charging current from the LTC1734. When DC is connected (either via the external adapter, or via USB), we try @@ -790,7 +790,7 @@ static void power_thread(void) powermgmt_last_cycle_startstop_min++; #endif /* HAVE_CHARGE_CTRL*/ -#endif /* HAVE_LIION */ +#endif /* # if CONFIG_BATTERY == BATT_LIION2200 */ /* sleep for roughly a minute */ #ifdef HAVE_CHARGE_CTRL -- cgit v1.2.3