From 5d9759a76e7e6fc73c89751a1644fc57e1111ec4 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Wed, 4 Jan 2012 00:07:27 +0000 Subject: [PATCH] Fix reds by implementing a few more stubs, and undefining HAVE_STORAGE_FLUSH in the sim. Also slight change on how to measure seconds. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31550 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/config/sim.h | 1 + uisimulator/common/powermgmt-sim.c | 27 +++++++++++++++++++++------ uisimulator/common/stubs.c | 4 ++++ 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/firmware/export/config/sim.h b/firmware/export/config/sim.h index f565e6192e..1f545c5f36 100644 --- a/firmware/export/config/sim.h +++ b/firmware/export/config/sim.h @@ -33,6 +33,7 @@ #undef NUM_DRIVES #undef HAVE_HOTSWAP #undef HAVE_HOTSWAP_STORAGE_AS_MAIN +#undef HAVE_STORAGE_FLUSH #undef CONFIG_STORAGE diff --git a/uisimulator/common/powermgmt-sim.c b/uisimulator/common/powermgmt-sim.c index 2d9acab51d..7500b3dd7b 100644 --- a/uisimulator/common/powermgmt-sim.c +++ b/uisimulator/common/powermgmt-sim.c @@ -42,13 +42,10 @@ void powermgmt_init_target(void) {} static void battery_status_update(void) { - static time_t last_change = 0; - time_t now; + static long last_tick = 0; - time(&now); - - if (last_change < now) { - last_change = now; + if (TIME_AFTER(current_tick, (last_tick+HZ))) { + last_tick = current_tick; /* change the values: */ if (charging) { @@ -121,3 +118,21 @@ void lineout_set(bool enable) (void)enable; } #endif + +#ifdef HAVE_REMOTE_LCD +bool remote_detect(void) +{ + return true; +} +#endif + +#ifdef HAVE_BATTERY_SWITCH +unsigned int input_millivolts(void) +{ + if ((power_input_status() & POWER_INPUT_BATTERY) == 0) { + /* Just return a safe value if battery isn't connected */ + return 4050; + } + return battery_voltage();; +} +#endif diff --git a/uisimulator/common/stubs.c b/uisimulator/common/stubs.c index ba4faff6e2..de53b6bb64 100644 --- a/uisimulator/common/stubs.c +++ b/uisimulator/common/stubs.c @@ -99,6 +99,10 @@ void mp3_play_data(const unsigned char* start, int size, (void)start; (void)size; (void)get_more; } +void mp3_shutdown(void) +{ +} + /* firmware/drivers/audio/mas35xx.c */ #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) void audiohw_set_loudness(int value)