From 0dd1f8ec11f28fe34c93ba97af95eb2be2fef44f Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Tue, 6 Jun 2006 22:23:52 +0000 Subject: Work-in-progress rework of charging status reading & display: * Changed several charging related HAVE_* macros into one multi-value CONFIG_CHARGING. * Always use proper macros for charging states. * Battery symbol charging animation now starts from current level on all targets with charging. Two-colour animation kept for non-b&w targets. Round down fill level while charging as before, but round to nearest pixel value for discharging on all targets. * Charging anim fixed on player. * Some code cleanup. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10080 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/powermgmt.h | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'firmware/export/powermgmt.h') diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h index 6c31aee..30fe60c 100644 --- a/firmware/export/powermgmt.h +++ b/firmware/export/powermgmt.h @@ -28,7 +28,7 @@ #ifndef SIMULATOR -#ifdef HAVE_CHARGE_CTRL +#if CONFIG_CHARGING == CHARGING_CONTROL #define START_TOPOFF_CHG 85 /* Battery % to start at top-off */ #define START_TRICKLE_CHG 95 /* Battery % to start at trickle */ @@ -59,23 +59,21 @@ extern int pid_p; /* PID proportional term */ extern int pid_i; /* PID integral term */ extern int trickle_sec; /* trickle charge: How many seconds per minute are we charging actually? */ -#endif /* HAVE_CHARGE_CTRL */ +#endif /* CONFIG_CHARGING == CHARGING_CONTROL */ -#if defined(HAVE_CHARGE_CTRL) || \ - (CONFIG_BATTERY == BATT_LIION2200) || \ - defined(HAVE_CHARGE_STATE) -typedef enum { - DISCHARGING, - CHARGING, - TOPOFF, - TRICKLE +#if CONFIG_CHARGING >= CHARGING_MONITOR +typedef enum { /* sorted by increasing charging current */ + DISCHARGING = 0, + TRICKLE, /* Can occur for CONFIG_CHARGING >= CHARGING_MONITOR */ + TOPOFF, /* Can occur for CONFIG_CHARGING == CHARGING_CONTROL */ + CHARGING /* Can occur for all CONFIG_CHARGING options */ } charge_state_type; /* tells what the charger is doing */ extern charge_state_type charge_state; -#endif /* defined(HAVE_CHARGE_CTRL) || (CONFIG_BATTERY == BATT_LIION2200) */ +#endif /* CONFIG_CHARGING >= CHARGING_MONITOR */ -#ifdef HAVE_CHARGING +#ifdef CONFIG_CHARGING /* * Flag that the charger has been plugged in/removed: this is set for exactly * one time through the power loop when the charger has been plugged in. -- cgit v1.1