summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
90 90
91#ifdef SIMULATOR /***********************************************************/ 91#ifdef SIMULATOR /***********************************************************/
92 92
93#define TIME2CHANGE 10 /* change levels every 10 seconds */
94#define BATT_MINCVOLT 250 /* minimum centivolts of battery */ 93#define BATT_MINCVOLT 250 /* minimum centivolts of battery */
95#define BATT_MAXCVOLT 450 /* maximum centivolts of battery */ 94#define BATT_MAXCVOLT 450 /* maximum centivolts of battery */
96#define BATT_MAXRUNTIME (10 * 60) /* maximum runtime with full battery in minutes */ 95#define BATT_MAXRUNTIME (10 * 60) /* maximum runtime with full battery in minutes */
@@ -105,11 +104,11 @@ static void battery_status_update(void)
105 time_t now; 104 time_t now;
106 105
107 time(&now); 106 time(&now);
108 if (last_change < (now - TIME2CHANGE)) { 107 if (last_change < now) {
109 last_change = now; 108 last_change = now;
110 109
111 /* change the values: */ 110 /* change the values: */
112 batt_centivolts -= (unsigned int)(BATT_MAXCVOLT - BATT_MINCVOLT) / 11; 111 batt_centivolts -= (unsigned int)(BATT_MAXCVOLT - BATT_MINCVOLT) / 101;
113 if (batt_centivolts < (unsigned int)BATT_MINCVOLT) 112 if (batt_centivolts < (unsigned int)BATT_MINCVOLT)
114 batt_centivolts = (unsigned int)BATT_MAXCVOLT; 113 batt_centivolts = (unsigned int)BATT_MAXCVOLT;
115 114