diff options
-rw-r--r-- | firmware/powermgmt.c | 3 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/powermgmt-mr100.c | 7 |
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) | |||
798 | #endif | 798 | #endif |
799 | 799 | ||
800 | /* Delay reading the first battery level */ | 800 | /* Delay reading the first battery level */ |
801 | #ifdef MROBE_100 | ||
802 | while(battery_adc_voltage()>4200) /* gives false readings initially */ | ||
803 | #endif | ||
801 | sleep(HZ/100); | 804 | sleep(HZ/100); |
802 | 805 | ||
803 | /* initialize the voltages for the exponential filter */ | 806 | /* 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 @@ | |||
22 | #include "adc.h" | 22 | #include "adc.h" |
23 | #include "powermgmt.h" | 23 | #include "powermgmt.h" |
24 | 24 | ||
25 | /* FIXME: All voltages copied from H10/Tatung Elio. This will need changing | ||
26 | proper power management. */ | ||
27 | |||
28 | const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = | 25 | const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = |
29 | { | 26 | { |
30 | 3450 | 27 | 3450 |
@@ -61,7 +58,5 @@ const unsigned short percent_to_volt_charge[11] = | |||
61 | /* Returns battery voltage from ADC [millivolts] */ | 58 | /* Returns battery voltage from ADC [millivolts] */ |
62 | unsigned int battery_adc_voltage(void) | 59 | unsigned int battery_adc_voltage(void) |
63 | { | 60 | { |
64 | /* work around the inital (false) high readout */ | 61 | return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10; |
65 | int readout=adc_read(ADC_UNREG_POWER); | ||
66 | return (readout>700) ? 3480 : (readout * BATTERY_SCALE_FACTOR) >> 10; | ||
67 | } | 62 | } |