dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Re: Rockbox for the player

Re: Rockbox for the player

From: Paul Suade <>
Date: Thu, 12 Sep 2002 13:38:15 +0200

Okay, there just a minor difference : my code was intended to be called
periodically whatever hd is pinning up or not so you can have a more
occurate snapshot of battery level (average is only here to flatten
fluctuation), using a second ring which contains the average values of the
first ring and can serve for historical and correction purpose. Which is
basically you seem to do.

Another possibility is to compute also the average difference between
average values to determine its average "slope" and display the battery
level according its average "value" AND its average "slope".

higher the average slope is, higher the discharge is. Another purpose of
slope computation : how many hours are theorically left for rockbox running
fine ?

----- Original Message -----
From: "Heikki Hannikainen" <>
To: "Rockbox" <>
Sent: Thursday, September 12, 2002 8:50 AM
Subject: Re: Rockbox for the player

> On Thu, 12 Sep 2002, Paul Suade wrote:
> > Well, maybe using an average for a short time might flat the flickering
> > value; I mean using a small array like a ring to put your battery level
> > computing the average that way :
> This is what we do already - see firmware/powermgmt.c. We take 4 samples
> a minute, discard samples taken while the disk is spinning to smooth it
> some more, calculate an average of the samples left, and put it in a table
> containing one sample per minute.
> battery_level() which returns a "percentage" of battery level calculates
> an average over the last three values in the table, ie. average of 3
> minutes. This really does not jump up/down too much any more and is much
> better than the direct voltage sample which we used before (it varied A
> LOT).
> The only jump you will usually get is in the beginning after the first
> minute. When the device boots, we quickly take (in power_init()) a single
> sample and initialize the history table with it so that we would have
> something to use before we have the first full minute sample. At
> boot-time, the disk has been spinning for a while loading the firmware,
> and the battery is a bit lower than average, and the next sample is
> usually a bit higher than the boot-time sample. But I don't think this is
> much of a problem.
> - Hessu
Received on 2002-09-12

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy