summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-01-30 16:25:46 +0000
committerJens Arnold <amiconn@rockbox.org>2005-01-30 16:25:46 +0000
commit91846a1a8d94dc8c7540efe3bbc8216f6ded7cb2 (patch)
tree8a8f0c328495e0631e568c1bdbe7c151e2590190 /firmware/export
parent8a77317e9c7c708153d8547bfccc3b4ef2324e3c (diff)
downloadrockbox-91846a1a8d94dc8c7540efe3bbc8216f6ded7cb2.zip
rockbox-91846a1a8d94dc8c7540efe3bbc8216f6ded7cb2.tar.gz
rockbox-91846a1a8d94dc8c7540efe3bbc8216f6ded7cb2.tar.bz2
rockbox-91846a1a8d94dc8c7540efe3bbc8216f6ded7cb2.tar.xz
New Ondio feature: Battery type setting, for correct battery level display.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5717 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/config-ondiofm.h2
-rw-r--r--firmware/export/config-ondiosp.h2
-rw-r--r--firmware/export/config.h6
-rw-r--r--firmware/export/powermgmt.h8
4 files changed, 11 insertions, 7 deletions
diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h
index 99d4c48..79e7adb 100644
--- a/firmware/export/config-ondiofm.h
+++ b/firmware/export/config-ondiofm.h
@@ -26,7 +26,7 @@
#define CONFIG_I2C I2C_ONDIO
/* Type of mobile power */
-#define CONFIG_BATTERY BATT_3AAA_ALKALINE
+#define CONFIG_BATTERY BATT_3AAA
/* Battery scale factor (average from 3 Ondios) */
#define BATTERY_SCALE_FACTOR 4735
diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h
index 41bc83b..bda078a 100644
--- a/firmware/export/config-ondiosp.h
+++ b/firmware/export/config-ondiosp.h
@@ -20,7 +20,7 @@
#define CPU_FREQ 12000000
/* Type of mobile power */
-#define CONFIG_BATTERY BATT_3AAA_ALKALINE
+#define CONFIG_BATTERY BATT_3AAA
/* Battery scale factor (average from 3 Ondios) */
#define BATTERY_SCALE_FACTOR 4735
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 4a55fbc..64694af 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -45,9 +45,9 @@
#define GMINI100_PAD 4
/* CONFIG_BATTERY */
-#define BATT_LIION2200 2200 /* FM/V2 recorder type */
-#define BATT_4AA_NIMH 1500
-#define BATT_3AAA_ALKALINE 1000
+#define BATT_LIION2200 2200 /* FM/V2 recorder type */
+#define BATT_4AA_NIMH 1500
+#define BATT_3AAA 1000 /* Ondio */
/* CONFIG_LCD */
#define LCD_GMINI100 0
diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h
index 2847156..ce006e9 100644
--- a/firmware/export/powermgmt.h
+++ b/firmware/export/powermgmt.h
@@ -26,13 +26,15 @@
#define BATTERY_LEVEL_FULL 400 /* 4.00V */
#define BATTERY_CAPACITY_MIN 2200
#define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable in settings */
-#elif CONFIG_BATTERY == BATT_3AAA_ALKALINE /* Ondio, Alkalines */
+#define BATTERY_TYPES_COUNT 1
+#elif CONFIG_BATTERY == BATT_3AAA /* Ondio */
#define BATTERY_LEVEL_SHUTDOWN 260 /* 2.60V */
#define BATTERY_LEVEL_EMPTY 270 /* 2.70V */
#define BATTERY_LEVEL_DANGEROUS 280 /* 2.80V */
-#define BATTERY_LEVEL_FULL 450 /* 4.50V */
+#define BATTERY_LEVEL_FULL 475 /* 4.75V */
#define BATTERY_CAPACITY_MIN 500
#define BATTERY_CAPACITY_MAX 1500 /* max. capacity selectable in settings */
+#define BATTERY_TYPES_COUNT 2 /* Alkalines or NiMH */
#else /* Recorder, NiMH */
#define BATTERY_LEVEL_SHUTDOWN 450 /* 4.50V */
#define BATTERY_LEVEL_EMPTY 465 /* 4.65V */
@@ -40,6 +42,7 @@
#define BATTERY_LEVEL_FULL 585 /* 5.85V */
#define BATTERY_CAPACITY_MIN 1500
#define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable in settings */
+#define BATTERY_TYPES_COUNT 1
#endif
#define BATTERY_RANGE (BATTERY_LEVEL_FULL - BATTERY_LEVEL_EMPTY)
@@ -111,6 +114,7 @@ bool battery_level_safe(void);
void set_poweroff_timeout(int timeout);
void set_battery_capacity(int capacity); /* set local battery capacity value */
+void set_battery_type(int type); /* set local battery type */
void set_sleep_timer(int seconds);
int get_sleep_timer(void);