summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/config/xduoox3.h2
-rw-r--r--firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c20
2 files changed, 16 insertions, 6 deletions
diff --git a/firmware/export/config/xduoox3.h b/firmware/export/config/xduoox3.h
index 30f0330edd..18d396a515 100644
--- a/firmware/export/config/xduoox3.h
+++ b/firmware/export/config/xduoox3.h
@@ -114,7 +114,7 @@
114#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */ 114#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
115#define BATTERY_CAPACITY_MAX 2000 /* max. capacity selectable */ 115#define BATTERY_CAPACITY_MAX 2000 /* max. capacity selectable */
116#define BATTERY_CAPACITY_INC 100 /* capacity increment */ 116#define BATTERY_CAPACITY_INC 100 /* capacity increment */
117#define BATTERY_TYPES_COUNT 1 /* only one type */ 117#define BATTERY_TYPES_COUNT 2 /* Two types (2000mAh and 1500mAh) */
118 118
119#define CURRENT_NORMAL 167 // 2.78mA * 60s 119#define CURRENT_NORMAL 167 // 2.78mA * 60s
120#define CURRENT_BACKLIGHT 180 // 15mA * 60s 120#define CURRENT_BACKLIGHT 180 // 15mA * 60s
diff --git a/firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c b/firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c
index e1e578ae67..ffc6f25a38 100644
--- a/firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c
+++ b/firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c
@@ -148,29 +148,39 @@ void KEY_INT_IRQ(void)
148{ 148{
149} 149}
150 150
151/* Notes on batteries
152
153 xDuoo shipped two types of batteries:
154
155 First is the 2000mAh battery shipped in newer units
156 Second is the 1500mAh battery shipped in older units
157
158*/
159
151const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = 160const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
152{ 161{
153 /* 5% */ 162 /* 5% */
154 3414 163 3414, 3634
155}; 164};
156 165
157const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = 166const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
158{ 167{
159 /* 0% */ 168 /* 0% */
160 3307 169 3307, 3307
161}; 170};
162 171
163
164/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ 172/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
165const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = 173const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
166{ 174{
167 { 3307, 3459, 3530, 3575, 3608, 3648, 3723, 3819, 3918, 4022, 4162 } 175 { 3307, 3459, 3530, 3575, 3608, 3648, 3723, 3819, 3918, 4022, 4162 },
176 { 3300, 3652, 3704, 3730, 3753, 3786, 3836, 3906, 3973, 4061, 4160 }
168}; 177};
169 178
170#if CONFIG_CHARGING 179#if CONFIG_CHARGING
171/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ 180/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
172const unsigned short percent_to_volt_charge[11] = 181const unsigned short percent_to_volt_charge[11] =
173 { 3307, 3459, 3530, 3575, 3608, 3648, 3723, 3819, 3918, 4022, 4162 }; 182// { 3300, 3652, 3704, 3730, 3753, 3786, 3836, 3906, 3973, 4061, 4160 };
183 { 3444, 3827, 3893, 3909, 3931, 4001, 4067, 4150, 4206, 4207, 4208 };
174#endif /* CONFIG_CHARGING */ 184#endif /* CONFIG_CHARGING */
175 185
176/* VBAT = (BDATA/1024) * 2.5V */ 186/* VBAT = (BDATA/1024) * 2.5V */