From 3157e1395674a930c74e2ef4cc4ce78dffea8569 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 24 Dec 2008 16:58:41 +0000 Subject: Simplify powermgmt thread loops so it calls functions turn (no more power_thread_sleep). Do other target-friendly simplifications, generic battery switch handling and split sim-specific code. Whoever can, please verify charging on the Archos Recorder (due to change in the charger duty cycle code). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19579 a1c6a512-1295-4272-9138-f99709370657 --- .../target/arm/imx31/gigabeat-s/powermgmt-target.h | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'firmware/target/arm/imx31/gigabeat-s/powermgmt-target.h') diff --git a/firmware/target/arm/imx31/gigabeat-s/powermgmt-target.h b/firmware/target/arm/imx31/gigabeat-s/powermgmt-target.h index 8ad4af8d18..1b55a4ed24 100644 --- a/firmware/target/arm/imx31/gigabeat-s/powermgmt-target.h +++ b/firmware/target/arm/imx31/gigabeat-s/powermgmt-target.h @@ -53,6 +53,7 @@ #define BATT_VTRICKLE_CHARGE 2900 /* Must charge slowly */ #define BATT_VSLOW_CHARGE 3500 /* Lower-current charge mode below * this level */ +#define BATT_FULL_VOLTAGE 4161 /* Battery already topped */ #define BATT_VAUTO_RECHARGE 4100 /* When to begin another cycle */ #define BATT_USB_VAUTO_RECHARGE 4000 /* When to cycle with USB only */ #define BATT_USB_VSTOP 4140 /* When to "stop" when USB only */ @@ -92,23 +93,13 @@ #define BATT_AVE_SAMPLES 32 #define ICHARGER_AVE_SAMPLES 32 +void powermgmt_init_target(void); +void charging_algorithm_step(void); +void charging_algorithm_close(void); + /* Provide filtered charge current */ int battery_charge_current(void); -#ifndef SIMULATOR -/* Indicate various functions that require implementation at the target level. - * This is because the battery could be low or the battery switch is off but - * with the main charger attached which implies safe power for anything. The - * true battery reading is always reported for voltage readings and not the - * value at the application supply. */ -#define TARGET_QUERY_FORCE_SHUTDOWN - -/* For this the application supply is read out if the charger is attached or - * the battery read if not (completely hardware selected at BP). */ -#define TARGET_BATTERY_LEVEL_SAFE - -/* The state should be adjusted to CHARGING or DISCHARGING */ -#define TARGET_POWERMGMT_FILTER_CHARGE_STATE -#endif /* SIMULATOR */ +#define CURRENT_MAX_CHG battery_charge_current() #endif /* POWERMGMT_TARGET_H */ -- cgit v1.2.3