summaryrefslogtreecommitdiffstats
path: root/firmware
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
parent43980bb8771dbd2c59104d0227322d3952267d3f (diff)
downloadrockbox-ae58b5aafe2f808968a05a5efb97e7e5f5c89bc4.tar.gz
rockbox-ae58b5aafe2f808968a05a5efb97e7e5f5c89bc4.tar.bz2
rockbox-ae58b5aafe2f808968a05a5efb97e7e5f5c89bc4.zip
xduoox20: UI Simulator support
Change-Id: I2a03cea07fbad9fb5862ca69e4cfca2e8ca6b17f
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/powermgmt.h2
-rw-r--r--firmware/powermgmt.c13
-rw-r--r--firmware/target/hosted/sdl/sim-ui-defines.h8
3 files changed, 14 insertions, 9 deletions
diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h
index f6b71a864e..235f5302f9 100644
--- a/firmware/export/powermgmt.h
+++ b/firmware/export/powermgmt.h
@@ -80,7 +80,7 @@ void powermgmt_init(void) INIT_ATTR;
/* Generic current values that are intentionally meaningless - config header
* should define proper numbers.*/
-
+
#ifndef CURRENT_BACKLIGHT
#define CURRENT_BACKLIGHT 5 /* additional current when backlight always on */
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
diff --git a/firmware/target/hosted/sdl/sim-ui-defines.h b/firmware/target/hosted/sdl/sim-ui-defines.h
index 808804c01f..31c95b0e13 100644
--- a/firmware/target/hosted/sdl/sim-ui-defines.h
+++ b/firmware/target/hosted/sdl/sim-ui-defines.h
@@ -502,10 +502,10 @@
#elif defined(XDUOO_X20)
#define UI_TITLE "xDuoo X20"
-#define UI_WIDTH 322 /* width of GUI window */
-#define UI_HEIGHT 609 /* height of GUI window */
-#define UI_LCD_POSX 43
-#define UI_LCD_POSY 62
+#define UI_WIDTH 299 /* width of GUI window */
+#define UI_HEIGHT 602 /* height of GUI window */
+#define UI_LCD_POSX 32
+#define UI_LCD_POSY 60
#elif defined(IHIFI770)
#define UI_TITLE "iHiFi 770"