summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Everton <dan@iocaine.org>2006-12-06 11:20:43 +0000
committerDan Everton <dan@iocaine.org>2006-12-06 11:20:43 +0000
commit761122dcff4158b68a0d3f977cff554c4e8365e3 (patch)
tree87056cad9bfd36f8589c723f8f643468f1da142d
parentedbd1cde47bb85f718970679c8b12a3fb98afac2 (diff)
downloadrockbox-761122dcff4158b68a0d3f977cff554c4e8365e3.tar.gz
rockbox-761122dcff4158b68a0d3f977cff554c4e8365e3.zip
Fix for FS#6328. Simulator battery level now goes down in roughly 1% increments roughly every second.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11673 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/powermgmt.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index dcf8fd14ab..ed0e69ef96 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -90,7 +90,6 @@ static int shutdown_timeout = 0;
#ifdef SIMULATOR /***********************************************************/
-#define TIME2CHANGE 10 /* change levels every 10 seconds */
#define BATT_MINCVOLT 250 /* minimum centivolts of battery */
#define BATT_MAXCVOLT 450 /* maximum centivolts of battery */
#define BATT_MAXRUNTIME (10 * 60) /* maximum runtime with full battery in minutes */
@@ -105,11 +104,11 @@ static void battery_status_update(void)
time_t now;
time(&now);
- if (last_change < (now - TIME2CHANGE)) {
+ if (last_change < now) {
last_change = now;
/* change the values: */
- batt_centivolts -= (unsigned int)(BATT_MAXCVOLT - BATT_MINCVOLT) / 11;
+ batt_centivolts -= (unsigned int)(BATT_MAXCVOLT - BATT_MINCVOLT) / 101;
if (batt_centivolts < (unsigned int)BATT_MINCVOLT)
batt_centivolts = (unsigned int)BATT_MAXCVOLT;