summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--firmware/powermgmt.c3
-rw-r--r--firmware/target/arm/olympus/mrobe-100/powermgmt-mr100.c7
2 files changed, 4 insertions, 6 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index d1efa29dca..072a31fa3f 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -798,6 +798,9 @@ static void power_thread(void)
#endif
/* Delay reading the first battery level */
+#ifdef MROBE_100
+ while(battery_adc_voltage()>4200) /* gives false readings initially */
+#endif
sleep(HZ/100);
/* initialize the voltages for the exponential filter */
diff --git a/firmware/target/arm/olympus/mrobe-100/powermgmt-mr100.c b/firmware/target/arm/olympus/mrobe-100/powermgmt-mr100.c
index 4bb60c3014..71781182fa 100644
--- a/firmware/target/arm/olympus/mrobe-100/powermgmt-mr100.c
+++ b/firmware/target/arm/olympus/mrobe-100/powermgmt-mr100.c
@@ -22,9 +22,6 @@
#include "adc.h"
#include "powermgmt.h"
-/* FIXME: All voltages copied from H10/Tatung Elio. This will need changing
- proper power management. */
-
const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
{
3450
@@ -61,7 +58,5 @@ const unsigned short percent_to_volt_charge[11] =
/* Returns battery voltage from ADC [millivolts] */
unsigned int battery_adc_voltage(void)
{
- /* work around the inital (false) high readout */
- int readout=adc_read(ADC_UNREG_POWER);
- return (readout>700) ? 3480 : (readout * BATTERY_SCALE_FACTOR) >> 10;
+ return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10;
}