summaryrefslogtreecommitdiffstats
path: root/firmware/powermgmt.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-09-28 15:03:21 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-09-28 21:12:52 -0400
commitae58b5aafe2f808968a05a5efb97e7e5f5c89bc4 (patch)
treee5a031afc1cd8c8feec1de83d96be25b6f8181c7 /firmware/powermgmt.c
parent43980bb8771dbd2c59104d0227322d3952267d3f (diff)
downloadrockbox-ae58b5aafe2f808968a05a5efb97e7e5f5c89bc4.tar.gz
rockbox-ae58b5aafe2f808968a05a5efb97e7e5f5c89bc4.tar.bz2
rockbox-ae58b5aafe2f808968a05a5efb97e7e5f5c89bc4.zip
xduoox20: UI Simulator support
Change-Id: I2a03cea07fbad9fb5862ca69e4cfca2e8ca6b17f
Diffstat (limited to 'firmware/powermgmt.c')
-rw-r--r--firmware/powermgmt.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index b55690be96..0e4a7df57b 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -86,11 +86,16 @@ static int poweroff_timeout = 0;
static long last_event_tick = 0;
#if (CONFIG_BATTERY_MEASURE & PERCENTAGE_MEASURE) == PERCENTAGE_MEASURE
+int _battery_level(void) { return -1; }
+#ifdef SIMULATOR
+int _battery_voltage(void);
+extern const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11];
+extern const unsigned short percent_to_volt_charge[11];
+#else
int _battery_voltage(void) { return -1; }
-
const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11];
const unsigned short percent_to_volt_charge[11];
-
+#endif
#elif (CONFIG_BATTERY_MEASURE & VOLTAGE_MEASURE) == VOLTAGE_MEASURE
int _battery_level(void) { return -1; }
/*
@@ -363,7 +368,7 @@ static int runcurrent(void)
#endif
#endif /* BOOTLOADER */
-
+
return current;
}
@@ -659,7 +664,7 @@ static inline void power_thread_step(void)
average_step_low();
/* update battery status every time an update is available */
battery_status_update();
-
+
/*
* If battery is low, observe voltage during disk activity.
* Shut down if voltage drops below shutoff level and we are not