summaryrefslogtreecommitdiff
path: root/firmware/drivers
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@rockbox.org>2006-01-19 07:47:34 +0000
committerBrandon Low <lostlogic@rockbox.org>2006-01-19 07:47:34 +0000
commitcdacab3d89cdbbd8fd7c20b3b340e27352e6737e (patch)
treead1746cf51bdb56a1cdcabf0c38eb6a53244c431 /firmware/drivers
parent13414ae77a77d96ef2cb210d644880b847c9ca6f (diff)
Charging state reporting on H3x0
Don't read the GPIO every refresh of statusbar or gwps for plugged state, use a variable exported from powermgmt instead. Allow Custom WPS to access %bc for battery charge state on targets that support this. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8383 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r--firmware/drivers/power.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c
index da97233e57..8a20890228 100644
--- a/firmware/drivers/power.c
+++ b/firmware/drivers/power.c
@@ -148,6 +148,12 @@ void charger_enable(bool on)
}
#endif
+#ifdef HAVE_CHARGE_STATE
+bool charging_state(void) {
+ return (GPIO_READ & 0x00800000)?true:false;
+}
+#endif
+
#ifdef HAVE_SPDIF_POWER
void spdif_power_enable(bool on)
{