summaryrefslogtreecommitdiffstats
path: root/firmware/export
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2004-10-08 17:45:52 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2004-10-08 17:45:52 +0000
commit43079ea07f13a7631cd3c0e5993638235427a476 (patch)
tree13ff7f3370f2793797fe9bd51e4e459a5dda695f /firmware/export
parent5cf1c97aea10864ecb6c3836a5c17845a5906d79 (diff)
downloadrockbox-43079ea07f13a7631cd3c0e5993638235427a476.tar.gz
rockbox-43079ea07f13a7631cd3c0e5993638235427a476.zip
multiple battery types prepared (CONFIG_BATTERY)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5227 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/config-fmrecorder.h8
-rw-r--r--firmware/export/config-h100.h5
-rw-r--r--firmware/export/config-ondiofm.h3
-rw-r--r--firmware/export/config-ondiosp.h3
-rw-r--r--firmware/export/config-player.h5
-rw-r--r--firmware/export/config-recorder.h5
-rw-r--r--firmware/export/config-recorderv2.h8
-rw-r--r--firmware/export/config.h5
-rw-r--r--firmware/export/powermgmt.h4
9 files changed, 33 insertions, 13 deletions
diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h
index af7ca91315..8d3f1a1051 100644
--- a/firmware/export/config-fmrecorder.h
+++ b/firmware/export/config-fmrecorder.h
@@ -25,9 +25,6 @@
/* Define this if you have a FM Recorder key system */
#define HAVE_FMADC 1
-/* Define this if you have a LiIon battery */
-#define HAVE_LIION
-
/* Define this if you need to power on ATA */
#define NEEDS_ATA_POWER_ON
@@ -37,6 +34,9 @@
/* Define this to the CPU frequency */
#define CPU_FREQ 11059200
+/* Type of mobile power */
+#define CONFIG_BATTERY BATT_LIION2200
+
/* Battery scale factor (guessed, seems to be 1,25 * value from recorder) */
#define BATTERY_SCALE_FACTOR 8081
@@ -61,7 +61,7 @@
/* How to detect USB */
#define USB_FMRECORDERSTYLE 1
-/* Define this if the platform has batteries */
+/* Define this if the platform can charge batteries */
#define HAVE_BATTERIES 1
/* The start address index for ROM builds */
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h
index 343fc89b42..a3e982a062 100644
--- a/firmware/export/config-h100.h
+++ b/firmware/export/config-h100.h
@@ -16,7 +16,10 @@
/* Define this if you have a Motorola SCF5249 */
#define CONFIG_CPU MCF5249
-/* Define this if the platform has batteries */
+/* Type of mobile power, FIXME: probably different, make new type */
+#define CONFIG_BATTERY BATT_LIION2200
+
+/* Define this if the platform can charge batteries */
#define HAVE_BATTERIES 1
/* The start address index for ROM builds */
diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h
index f7d9a8f33f..f7cff94f5e 100644
--- a/firmware/export/config-ondiofm.h
+++ b/firmware/export/config-ondiofm.h
@@ -22,6 +22,9 @@
/* Define this to the CPU frequency */
#define CPU_FREQ 12000000
+/* Type of mobile power */
+#define CONFIG_BATTERY BATT_3AAA_ALKALINE
+
/* Battery scale factor (measured from Jörg's FM) */
#define BATTERY_SCALE_FACTOR 4785 /* 4.890V read as 0x3FE */
diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h
index b4c9f0d572..111787ffc9 100644
--- a/firmware/export/config-ondiosp.h
+++ b/firmware/export/config-ondiosp.h
@@ -19,6 +19,9 @@
/* Define this to the CPU frequency */
#define CPU_FREQ 12000000
+/* Type of mobile power */
+#define CONFIG_BATTERY BATT_3AAA_ALKALINE
+
/* Battery scale factor (measured from Jörg's FM) */
#define BATTERY_SCALE_FACTOR 4785 /* 4.890V read as 0x3FE */
diff --git a/firmware/export/config-player.h b/firmware/export/config-player.h
index 8bd63c42e6..d457ef40fd 100644
--- a/firmware/export/config-player.h
+++ b/firmware/export/config-player.h
@@ -22,6 +22,9 @@
/* Define this to the CPU frequency */
#define CPU_FREQ 12000000 /* cycle time ~83.3ns */
+/* Type of mobile power */
+#define CONFIG_BATTERY BATT_4AA_NIMH
+
/* Battery scale factor (?) */
#define BATTERY_SCALE_FACTOR 6546
@@ -44,7 +47,7 @@
/* How to detect USB */
#define USB_PLAYERSTYLE 1
-/* Define this if the platform has batteries */
+/* Define this if the platform can charge batteries */
#define HAVE_BATTERIES 1
/* Define this for programmable LED available */
diff --git a/firmware/export/config-recorder.h b/firmware/export/config-recorder.h
index 89e19f32f6..1e90a05248 100644
--- a/firmware/export/config-recorder.h
+++ b/firmware/export/config-recorder.h
@@ -34,6 +34,9 @@
/* Define this to the CPU frequency */
#define CPU_FREQ 11059200
+/* Type of mobile power */
+#define CONFIG_BATTERY BATT_4AA_NIMH
+
/* Battery scale factor (?) */
#define BATTERY_SCALE_FACTOR 6465
@@ -52,7 +55,7 @@
/* How to detect USB */
#define USB_RECORDERSTYLE 1
-/* Define this if the platform has batteries */
+/* Define this if the platform can charge batteries */
#define HAVE_BATTERIES 1
/* The start address index for ROM builds */
diff --git a/firmware/export/config-recorderv2.h b/firmware/export/config-recorderv2.h
index 56967cfa10..b676a180ed 100644
--- a/firmware/export/config-recorderv2.h
+++ b/firmware/export/config-recorderv2.h
@@ -25,9 +25,6 @@
/* Define this if you have a FM Recorder key system */
#define HAVE_FMADC 1
-/* Define this if you have a LiIon battery */
-#define HAVE_LIION
-
/* Define this if you need to power on ATA */
#define NEEDS_ATA_POWER_ON
@@ -37,6 +34,9 @@
/* Define this to the CPU frequency */
#define CPU_FREQ 11059200
+/* Type of mobile power */
+#define CONFIG_BATTERY BATT_LIION2200
+
/* Battery scale factor (guessed, seems to be 1,25 * value from recorder) */
#define BATTERY_SCALE_FACTOR 8081
@@ -61,7 +61,7 @@
/* How to detect USB */
#define USB_FMRECORDERSTYLE 1
-/* Define this if the platform has batteries */
+/* Define this if the platform can charge batteries */
#define HAVE_BATTERIES 1
/* The start address index for ROM builds */
diff --git a/firmware/export/config.h b/firmware/export/config.h
index fd757b1ab1..76a2bd9316 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -40,6 +40,11 @@
#define RECORDER_PAD 1
#define ONDIO_PAD 2
+/* CONFIG_BATTERY */
+#define BATT_LIION2200 2200 /* FM/V2 recorder type */
+#define BATT_4AA_NIMH 1500
+#define BATT_3AAA_ALKALINE 1000
+
/* now go and pick yours */
#if defined(ARCHOS_PLAYER)
#include "config-player.h"
diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h
index eb0ba29f28..1a54006a7d 100644
--- a/firmware/export/powermgmt.h
+++ b/firmware/export/powermgmt.h
@@ -19,7 +19,7 @@
#ifndef _POWERMGMT_H_
#define _POWERMGMT_H_
-#ifdef HAVE_LIION /* FM Recorder, LiIon */
+#if CONFIG_BATTERY == BATT_LIION2200 /* FM Recorder, LiIon */
#define BATTERY_LEVEL_SHUTDOWN 260 /* 2.60V */
#define BATTERY_LEVEL_EMPTY 265 /* 2.65V */
#define BATTERY_LEVEL_DANGEROUS 280 /* 2.80V */
@@ -71,7 +71,7 @@ extern int trickle_sec; /* trickle charge: How many seconds per minute
#endif /* HAVE_CHARGE_CTRL */
-#if defined(HAVE_CHARGE_CTRL) || defined(HAVE_LIION)
+#if defined(HAVE_CHARGE_CTRL) || CONFIG_BATTERY == BATT_LIION2200
extern int charge_state; /* tells what the charger is doing (for info display): 0: decharging/charger off, 1: charge, 2: top-off, 3: trickle */
#endif