diff options
| author | Heikki Hannikainen <hessuh@rockbox.org> | 2002-08-15 11:32:01 +0000 |
|---|---|---|
| committer | Heikki Hannikainen <hessuh@rockbox.org> | 2002-08-15 11:32:01 +0000 |
| commit | dd2bae49ebfbe44bf91c8444bc74ffaa600f8ae1 (patch) | |
| tree | 7c692769299cf30428c85025db8d1f260cd5e287 /firmware | |
| parent | fae5b82d604779dd25ea8f1dcaa5a543eff86531 (diff) | |
| download | rockbox-dd2bae49ebfbe44bf91c8444bc74ffaa600f8ae1.zip rockbox-dd2bae49ebfbe44bf91c8444bc74ffaa600f8ae1.tar.gz rockbox-dd2bae49ebfbe44bf91c8444bc74ffaa600f8ae1.tar.bz2 rockbox-dd2bae49ebfbe44bf91c8444bc74ffaa600f8ae1.tar.xz | |
avoid flickering of battery level during the first minute of uptime by taking a voltage sample at power_init
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1758 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
| -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 df796f9..8791338 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c @@ -235,6 +235,9 @@ void power_init(void) { /* init history to 0 */ memset(power_history, 0x00, sizeof(power_history)); + /* initialize the history with a single sample to prevent level + flickering during the first minute of execution */ + power_history[POWER_HISTORY_LEN-1] = (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) / 10000; #ifdef HAVE_CHARGE_CTRL snprintf(power_message, POWER_MESSAGE_LEN, "Powermgmt started"); |