From 761122dcff4158b68a0d3f977cff554c4e8365e3 Mon Sep 17 00:00:00 2001 From: Dan Everton Date: Wed, 6 Dec 2006 11:20:43 +0000 Subject: 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 --- firmware/powermgmt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'firmware/powermgmt.c') 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; -- cgit v1.2.3