diff options
-rw-r--r-- | firmware/powermgmt.c | 2 | ||||
-rw-r--r-- | uisimulator/common/powermgmt-sim.c | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c index 51ea99f6fa..7e1523eb57 100644 --- a/firmware/powermgmt.c +++ b/firmware/powermgmt.c | |||
@@ -103,10 +103,12 @@ static unsigned int avgbat; | |||
103 | /* filtered battery voltage, millivolts */ | 103 | /* filtered battery voltage, millivolts */ |
104 | static unsigned int battery_millivolts; | 104 | static unsigned int battery_millivolts; |
105 | #else | 105 | #else |
106 | #ifndef SIMULATOR | ||
106 | int _battery_voltage(void) { return -1; } | 107 | int _battery_voltage(void) { return -1; } |
107 | const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11]; | 108 | const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11]; |
108 | const unsigned short percent_to_volt_charge[11]; | 109 | const unsigned short percent_to_volt_charge[11]; |
109 | #endif | 110 | #endif |
111 | #endif | ||
110 | 112 | ||
111 | #if !(CONFIG_BATTERY_MEASURE & TIME_MEASURE) | 113 | #if !(CONFIG_BATTERY_MEASURE & TIME_MEASURE) |
112 | static int powermgmt_est_runningtime_min; | 114 | static int powermgmt_est_runningtime_min; |
diff --git a/uisimulator/common/powermgmt-sim.c b/uisimulator/common/powermgmt-sim.c index 3430b1ea79..511648bc9d 100644 --- a/uisimulator/common/powermgmt-sim.c +++ b/uisimulator/common/powermgmt-sim.c | |||
@@ -79,7 +79,7 @@ static void battery_status_update(void) | |||
79 | #if CONFIG_CHARGING >= CHARGING_MONITOR | 79 | #if CONFIG_CHARGING >= CHARGING_MONITOR |
80 | /* Keep external power until tick */ | 80 | /* Keep external power until tick */ |
81 | ext_power_until_tick = current_tick + POWER_AFTER_CHARGE_TICKS; | 81 | ext_power_until_tick = current_tick + POWER_AFTER_CHARGE_TICKS; |
82 | #elif CONFIG_CHARGING | 82 | #elif CONFIG_CHARGING |
83 | /* Pretend the charger was disconnected */ | 83 | /* Pretend the charger was disconnected */ |
84 | charger_input_state = CHARGER_UNPLUGGED; | 84 | charger_input_state = CHARGER_UNPLUGGED; |
85 | #endif | 85 | #endif |
@@ -111,13 +111,17 @@ const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = | |||
111 | const unsigned short percent_to_volt_charge[11] = | 111 | const unsigned short percent_to_volt_charge[11] = |
112 | { 3300, 3400, 3500, 3600, 3700, 3800, 3900, 4000, 4100, 4200, 4300 }; | 112 | { 3300, 3400, 3500, 3600, 3700, 3800, 3900, 4000, 4100, 4200, 4300 }; |
113 | 113 | ||
114 | |||
115 | int _battery_voltage(void) | 114 | int _battery_voltage(void) |
116 | { | 115 | { |
117 | battery_status_update(); | 116 | battery_status_update(); |
118 | return battery_millivolts; | 117 | return battery_millivolts; |
119 | } | 118 | } |
120 | 119 | ||
120 | #if (CONFIG_BATTERY_MEASURE & TIME_MEASURE) | ||
121 | static int powermgmt_est_runningtime_min; | ||
122 | int _battery_time(void) { return powermgmt_est_runningtime_min; } | ||
123 | #endif | ||
124 | |||
121 | #if CONFIG_CHARGING | 125 | #if CONFIG_CHARGING |
122 | unsigned int power_input_status(void) | 126 | unsigned int power_input_status(void) |
123 | { | 127 | { |