summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-08-07 13:32:35 +0000
committerThomas Martitz <kugel@rockbox.org>2009-08-07 13:32:35 +0000
commit0f50302b1d437496fc546d8b101df5766659ef1c (patch)
tree8027606512f5cab41e6bb021d7ad626d780d0832 /firmware
parent6e5448da22fc80e7ff882f8d26a57f48ce289f1f (diff)
downloadrockbox-0f50302b1d437496fc546d8b101df5766659ef1c.tar.gz
rockbox-0f50302b1d437496fc546d8b101df5766659ef1c.tar.bz2
rockbox-0f50302b1d437496fc546d8b101df5766659ef1c.zip
Samsung YH925: Support for battery monitoring and charging. Discharge curve not yet calibrated.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22194 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/config-yh925.h6
-rw-r--r--firmware/target/arm/samsung/adc-target.h2
-rw-r--r--firmware/target/arm/samsung/yh925/powermgmt-yh925.c3
3 files changed, 5 insertions, 6 deletions
diff --git a/firmware/export/config-yh925.h b/firmware/export/config-yh925.h
index bd15b5aa44..87b7a00ccc 100644
--- a/firmware/export/config-yh925.h
+++ b/firmware/export/config-yh925.h
@@ -131,9 +131,9 @@
#define AB_REPEAT_ENABLE 1
-#define BATTERY_CAPACITY_DEFAULT 1550 /* default battery capacity */
-#define BATTERY_CAPACITY_MIN 1500 /* min. capacity selectable */
-#define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */
+#define BATTERY_CAPACITY_DEFAULT 900 /* default battery capacity */
+#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
+#define BATTERY_CAPACITY_MAX 1150 /* max. capacity selectable */
#define BATTERY_CAPACITY_INC 50 /* capacity increment */
#define BATTERY_TYPES_COUNT 1 /* only one type */
diff --git a/firmware/target/arm/samsung/adc-target.h b/firmware/target/arm/samsung/adc-target.h
index a95bcd2e99..1f6a9dcb17 100644
--- a/firmware/target/arm/samsung/adc-target.h
+++ b/firmware/target/arm/samsung/adc-target.h
@@ -28,7 +28,7 @@
#define ADC_CHANNEL_2 2
#define ADC_CHANNEL_3 3
-#define ADC_BATTERY ADC_CHANNEL_0
+#define ADC_BATTERY ADC_CHANNEL_1
/*
#define ADC_UNKNOWN_1 1
#define ADC_REMOTE 2
diff --git a/firmware/target/arm/samsung/yh925/powermgmt-yh925.c b/firmware/target/arm/samsung/yh925/powermgmt-yh925.c
index 6d7e3487aa..8945bdbf78 100644
--- a/firmware/target/arm/samsung/yh925/powermgmt-yh925.c
+++ b/firmware/target/arm/samsung/yh925/powermgmt-yh925.c
@@ -54,6 +54,5 @@ const unsigned short percent_to_volt_charge[11] =
/* Returns battery voltage from ADC [millivolts] */
unsigned int battery_adc_voltage(void)
{
- /* return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10; */
- return 4100;
+ return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10;
}