diff options
| author | Daniel Ankers <dan@weirdo.org.uk> | 2006-12-10 22:58:59 +0000 |
|---|---|---|
| committer | Daniel Ankers <dan@weirdo.org.uk> | 2006-12-10 22:58:59 +0000 |
| commit | a5852f6855fa90d2bd833c50de8bf20f472e06f3 (patch) | |
| tree | ae0017f009327e4197e3faa569d6f2f21a23df3f | |
| parent | f98fd72fe7d1076cf7a7758a60541a65d5fda578 (diff) | |
| download | rockbox-a5852f6855fa90d2bd833c50de8bf20f472e06f3.zip rockbox-a5852f6855fa90d2bd833c50de8bf20f472e06f3.tar.gz rockbox-a5852f6855fa90d2bd833c50de8bf20f472e06f3.tar.bz2 rockbox-a5852f6855fa90d2bd833c50de8bf20f472e06f3.tar.xz | |
Charger detection for Sansa
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11710 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/export/config-e200.h | 6 | ||||
| -rw-r--r-- | firmware/target/arm/sandisk/sansa-e200/power-e200.c | 10 |
2 files changed, 13 insertions, 3 deletions
diff --git a/firmware/export/config-e200.h b/firmware/export/config-e200.h index 1bbdd60..e055373 100644 --- a/firmware/export/config-e200.h +++ b/firmware/export/config-e200.h @@ -4,7 +4,7 @@ #define TARGET_TREE /* this target is using the target tree system */ /* For Rolo and boot loader */ -#define MODEL_NUMBER 12 +#define MODEL_NUMBER 16 /* define this if you have recording possibility */ /*#define HAVE_RECORDING 1*/ /* TODO: add support for this */ @@ -82,11 +82,11 @@ #define BATTERY_SCALE_FACTOR 5865 /* Hardware controlled charging? FIXME */ -//#define CONFIG_CHARGING CHARGING_SIMPLE +#define CONFIG_CHARGING CHARGING_SIMPLE /* define this if the hardware can be powered off while charging */ /* TODO: should this be set for the H10? */ -//#define HAVE_POWEROFF_WHILE_CHARGING +#define HAVE_POWEROFF_WHILE_CHARGING /* The start address index for ROM builds */ #define ROM_START 0x00000000 diff --git a/firmware/target/arm/sandisk/sansa-e200/power-e200.c b/firmware/target/arm/sandisk/sansa-e200/power-e200.c index f1ce7e2..b902297 100644 --- a/firmware/target/arm/sandisk/sansa-e200/power-e200.c +++ b/firmware/target/arm/sandisk/sansa-e200/power-e200.c @@ -17,6 +17,9 @@ * ****************************************************************************/ +#include <stdbool.h> +#include "cpu.h" + void power_init(void) { } @@ -24,3 +27,10 @@ void power_init(void) void power_off(void) { } + +bool charger_inserted(void) +{ + if(GPIOB_INPUT_VAL & 0x10) + return true; + return false; +} |