diff options
-rw-r--r-- | firmware/powermgmt.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index df796f9140..8791338ab4 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c | |||
@@ -235,6 +235,9 @@ void power_init(void) | |||
235 | { | 235 | { |
236 | /* init history to 0 */ | 236 | /* init history to 0 */ |
237 | memset(power_history, 0x00, sizeof(power_history)); | 237 | memset(power_history, 0x00, sizeof(power_history)); |
238 | /* initialize the history with a single sample to prevent level | ||
239 | flickering during the first minute of execution */ | ||
240 | power_history[POWER_HISTORY_LEN-1] = (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) / 10000; | ||
238 | 241 | ||
239 | #ifdef HAVE_CHARGE_CTRL | 242 | #ifdef HAVE_CHARGE_CTRL |
240 | snprintf(power_message, POWER_MESSAGE_LEN, "Powermgmt started"); | 243 | snprintf(power_message, POWER_MESSAGE_LEN, "Powermgmt started"); |