Rockbox.org home
releases
current build
extras FAQ
manual
wiki
docs index mailing lists
IRC
forums bugs
patches



Rockbox mail archive

Subject: Battery and volume level display in WPS

Battery and volume level display in WPS

From: Tobias Heimann <tobias.heimann_at_gmx.net>
Date: Thu, 04 Jan 2007 01:58:37 +0100

Hi,

I've been wondering for a while why I never see a full battery icon in
the WPS for longer than a couple of minutes after recharging. Digging a
bit into the WPS code (for %bl), I found the following lines:

                    int l = battery_level();
                    limit = MAX(limit, 2);
                    if (l > -1)
                    {
                        snprintf(buf, buf_size, "%d", l);
                        /* First enum is used for "unknown level". */
                        *intval = (limit - 1) * l / 100 + 1 + 1;
                    }

This means that the highest interval (full battery icon) is only
returned for a level of 100, and 99 will already give you the second
highest interval. Is this intentional?
IMHO it would be more logical to spread the highest interval as the
other ones, e.g. using:

                     int l = MIN(battery_level(), 99);
                     ...
                     *intval = limit * l / 100 + 1 + 1;

The volume display interval has the same issue btw.

Tobias
Received on 2007-01-04


Page was last modified "Mar 9 2008" The Rockbox Crew