|
Rockbox mail archiveSubject: Battery and volume level display in WPSBattery 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 template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy |