From bba84a9ce256675c5c6b622863a4c14e048e5c7c Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sat, 31 Dec 2011 13:35:19 +0000 Subject: Enable (and fix) battery_bench on hosted targets. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31471 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/SOURCES | 5 +++-- apps/plugins/battery_bench.c | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index 387f1459ac..1b14c0dd5e 100644 --- a/apps/plugins/SOURCES +++ b/apps/plugins/SOURCES @@ -1,4 +1,7 @@ /* plugins common to all models */ +#ifndef SIMULATOR +battery_bench.c +#endif chessclock.c credits.c cube.c @@ -116,8 +119,6 @@ iriver_flash.c rockbox_flash.c #endif /* CONFIG_CPU */ -battery_bench.c - #if defined(IPOD_NANO2G) crypt_firmware.c #endif diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c index 302d74c02a..bf40fe1759 100644 --- a/apps/plugins/battery_bench.c +++ b/apps/plugins/battery_bench.c @@ -414,7 +414,9 @@ static void thread(void) bat[buf_idx].flags = charge_state(); #endif buf_idx++; +#if USING_STORAGE_CALLBACK rb->register_storage_idle_func(flush_buffer); +#endif } /* What to do when the measurement buffer is full: @@ -454,8 +456,12 @@ static void thread(void) } } +#if USING_STORAGE_CALLBACK /* unregister flush callback and flush to disk */ rb->unregister_storage_idle_func(flush_buffer, true); +#else + flush_buffer(NULL); +#endif /* log end of bench and exit reason */ fd = rb->open(BATTERY_LOG, O_RDWR | O_CREAT | O_APPEND, 0666); -- cgit v1.2.3