summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@rockbox.org>2006-01-27 01:19:14 +0000
committerBrandon Low <lostlogic@rockbox.org>2006-01-27 01:19:14 +0000
commit005c2f8026b227c1343157828b9e2a078cc7594d (patch)
treeb76189a8a098762d015cd1f33d6907bdefc799ca
parent3325d9915451bac9554217fce9e4d3c7529d91e2 (diff)
downloadrockbox-005c2f8026b227c1343157828b9e2a078cc7594d.tar.gz
rockbox-005c2f8026b227c1343157828b9e2a078cc7594d.tar.bz2
rockbox-005c2f8026b227c1343157828b9e2a078cc7594d.zip
Detect USB charge state in Hxx0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8462 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/power.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c
index b5d4d7d22a..c3f2d82db4 100644
--- a/firmware/drivers/power.c
+++ b/firmware/drivers/power.c
@@ -27,6 +27,7 @@
#include "logf.h"
#include "pcf50605.h"
#include "pcf50606.h"
+#include "usb.h"
#ifdef HAVE_CHARGE_CTRL
bool charger_enabled;
@@ -108,7 +109,7 @@ void power_init(void)
bool charger_inserted(void)
{
#if CONFIG_CPU == MCF5249
- return (GPIO1_READ & 0x00400000)?true:false;
+ return (GPIO1_READ & 0x00400000) || usb_powered();
#elif defined(GMINI_ARCH)
return (P7 & 0x80) == 0;
#elif defined(HAVE_CHARGE_CTRL)