diff options
-rw-r--r-- | firmware/powermgmt.c | 12 | ||||
-rw-r--r-- | firmware/powermgmt.h | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index 8fdb168e50..026bfe47c0 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c | |||
@@ -73,9 +73,15 @@ static int poweroff_idle_timeout_value[15] = | |||
73 | 73 | ||
74 | static int percent_to_volt_decharge[11] = /* voltages (centivolt) of 0%, 10%, ... 100% when charging disabled */ | 74 | static int percent_to_volt_decharge[11] = /* voltages (centivolt) of 0%, 10%, ... 100% when charging disabled */ |
75 | { | 75 | { |
76 | #ifdef HAVE_LIION | ||
77 | /* values guessed, see http://www.seattlerobotics.org/encoder/200210/LiIon2.pdf */ | ||
78 | /* until someone measures voltages over a decharging cycle */ | ||
79 | 260, 280, 300, 320, 340, 350, 360, 370, 380, 390, 400 | ||
80 | #else /* NiMH */ | ||
76 | /* original values were taken directly after charging, */ | 81 | /* original values were taken directly after charging, */ |
77 | /* but it should show 100% after turning off the device for some hours, too */ | 82 | /* but it should show 100% after turning off the device for some hours, too */ |
78 | 450, 481, 491, 497, 503, 507, 512, 514, 517, 525, 540 /* orig. values: ...,528,560 */ | 83 | 450, 481, 491, 497, 503, 507, 512, 514, 517, 525, 540 /* orig. values: ...,528,560 */ |
84 | #endif | ||
79 | }; | 85 | }; |
80 | 86 | ||
81 | void set_battery_capacity(int capacity) | 87 | void set_battery_capacity(int capacity) |
@@ -99,7 +105,13 @@ int charge_state = 0; /* at the beginning, the charger | |||
99 | 105 | ||
100 | static int percent_to_volt_charge[11] = /* voltages (centivolt) of 0%, 10%, ... 100% when charging enabled */ | 106 | static int percent_to_volt_charge[11] = /* voltages (centivolt) of 0%, 10%, ... 100% when charging enabled */ |
101 | { | 107 | { |
108 | #ifdef HAVE_LIION | ||
109 | /* values guessed, see http://www.seattlerobotics.org/encoder/200210/LiIon2.pdf */ | ||
110 | /* until someone measures voltages over a charging cycle */ | ||
111 | 260, 290, 320, 340, 360, 370, 380, 390, 400, 410, 420 | ||
112 | #else /* NiMH */ | ||
102 | 476, 544, 551, 556, 561, 564, 566, 576, 582, 584, 585 | 113 | 476, 544, 551, 556, 561, 564, 566, 576, 582, 584, 585 |
114 | #endif | ||
103 | }; | 115 | }; |
104 | 116 | ||
105 | void enable_trickle_charge(bool on) | 117 | void enable_trickle_charge(bool on) |
diff --git a/firmware/powermgmt.h b/firmware/powermgmt.h index 884e9772e5..a3e212b63a 100644 --- a/firmware/powermgmt.h +++ b/firmware/powermgmt.h | |||
@@ -21,13 +21,13 @@ | |||
21 | 21 | ||
22 | #ifndef SIMULATOR | 22 | #ifndef SIMULATOR |
23 | 23 | ||
24 | #ifdef HAVE_FMADC /* FM Recorder, LiIon */ | 24 | #ifdef HAVE_LIION /* FM Recorder, LiIon */ |
25 | #define BATTERY_LEVEL_SHUTDOWN 260 /* 2.60V */ | 25 | #define BATTERY_LEVEL_SHUTDOWN 260 /* 2.60V */ |
26 | #define BATTERY_LEVEL_EMPTY 265 /* 2.65V */ | 26 | #define BATTERY_LEVEL_EMPTY 265 /* 2.65V */ |
27 | #define BATTERY_LEVEL_DANGEROUS 280 /* 2.80V */ | 27 | #define BATTERY_LEVEL_DANGEROUS 280 /* 2.80V */ |
28 | #define BATTERY_LEVEL_FULL 400 /* 4.00V */ | 28 | #define BATTERY_LEVEL_FULL 400 /* 4.00V */ |
29 | 29 | ||
30 | #else /* Recorder, NiCd */ | 30 | #else /* Recorder, NiMH */ |
31 | #define BATTERY_LEVEL_SHUTDOWN 450 /* 4.50V */ | 31 | #define BATTERY_LEVEL_SHUTDOWN 450 /* 4.50V */ |
32 | #define BATTERY_LEVEL_EMPTY 465 /* 4.65V */ | 32 | #define BATTERY_LEVEL_EMPTY 465 /* 4.65V */ |
33 | #define BATTERY_LEVEL_DANGEROUS 475 /* 4.75V */ | 33 | #define BATTERY_LEVEL_DANGEROUS 475 /* 4.75V */ |