summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Ankers <dan@weirdo.org.uk>2006-12-10 22:58:59 +0000
committerDaniel Ankers <dan@weirdo.org.uk>2006-12-10 22:58:59 +0000
commita5852f6855fa90d2bd833c50de8bf20f472e06f3 (patch)
treeae0017f009327e4197e3faa569d6f2f21a23df3f
parentf98fd72fe7d1076cf7a7758a60541a65d5fda578 (diff)
downloadrockbox-a5852f6855fa90d2bd833c50de8bf20f472e06f3.tar.gz
rockbox-a5852f6855fa90d2bd833c50de8bf20f472e06f3.zip
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.h6
-rw-r--r--firmware/target/arm/sandisk/sansa-e200/power-e200.c10
2 files changed, 13 insertions, 3 deletions
diff --git a/firmware/export/config-e200.h b/firmware/export/config-e200.h
index 1bbdd6021e..e055373567 100644
--- a/firmware/export/config-e200.h
+++ b/firmware/export/config-e200.h
@@ -4,7 +4,7 @@
4#define TARGET_TREE /* this target is using the target tree system */ 4#define TARGET_TREE /* this target is using the target tree system */
5 5
6/* For Rolo and boot loader */ 6/* For Rolo and boot loader */
7#define MODEL_NUMBER 12 7#define MODEL_NUMBER 16
8 8
9/* define this if you have recording possibility */ 9/* define this if you have recording possibility */
10/*#define HAVE_RECORDING 1*/ /* TODO: add support for this */ 10/*#define HAVE_RECORDING 1*/ /* TODO: add support for this */
@@ -82,11 +82,11 @@
82#define BATTERY_SCALE_FACTOR 5865 82#define BATTERY_SCALE_FACTOR 5865
83 83
84/* Hardware controlled charging? FIXME */ 84/* Hardware controlled charging? FIXME */
85//#define CONFIG_CHARGING CHARGING_SIMPLE 85#define CONFIG_CHARGING CHARGING_SIMPLE
86 86
87/* define this if the hardware can be powered off while charging */ 87/* define this if the hardware can be powered off while charging */
88/* TODO: should this be set for the H10? */ 88/* TODO: should this be set for the H10? */
89//#define HAVE_POWEROFF_WHILE_CHARGING 89#define HAVE_POWEROFF_WHILE_CHARGING
90 90
91/* The start address index for ROM builds */ 91/* The start address index for ROM builds */
92#define ROM_START 0x00000000 92#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 f1ce7e27e6..b9022974d1 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 @@
17 * 17 *
18 ****************************************************************************/ 18 ****************************************************************************/
19 19
20#include <stdbool.h>
21#include "cpu.h"
22
20void power_init(void) 23void power_init(void)
21{ 24{
22} 25}
@@ -24,3 +27,10 @@ void power_init(void)
24void power_off(void) 27void power_off(void)
25{ 28{
26} 29}
30
31bool charger_inserted(void)
32{
33 if(GPIOB_INPUT_VAL & 0x10)
34 return true;
35 return false;
36}