diff options
author | Thomas Martitz <kugel@rockbox.org> | 2011-12-31 13:35:19 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2011-12-31 13:35:19 +0000 |
commit | bba84a9ce256675c5c6b622863a4c14e048e5c7c (patch) | |
tree | f7b5d28d43501840b97fe6cf1215fa268ee7e6cc | |
parent | 05f12e08772d1ca03101b176e329bfd313daf673 (diff) | |
download | rockbox-bba84a9ce256675c5c6b622863a4c14e048e5c7c.tar.gz rockbox-bba84a9ce256675c5c6b622863a4c14e048e5c7c.zip |
Enable (and fix) battery_bench on hosted targets.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31471 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/plugins/SOURCES | 5 | ||||
-rw-r--r-- | 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 @@ | |||
1 | /* plugins common to all models */ | 1 | /* plugins common to all models */ |
2 | #ifndef SIMULATOR | ||
3 | battery_bench.c | ||
4 | #endif | ||
2 | chessclock.c | 5 | chessclock.c |
3 | credits.c | 6 | credits.c |
4 | cube.c | 7 | cube.c |
@@ -116,8 +119,6 @@ iriver_flash.c | |||
116 | rockbox_flash.c | 119 | rockbox_flash.c |
117 | #endif /* CONFIG_CPU */ | 120 | #endif /* CONFIG_CPU */ |
118 | 121 | ||
119 | battery_bench.c | ||
120 | |||
121 | #if defined(IPOD_NANO2G) | 122 | #if defined(IPOD_NANO2G) |
122 | crypt_firmware.c | 123 | crypt_firmware.c |
123 | #endif | 124 | #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) | |||
414 | bat[buf_idx].flags = charge_state(); | 414 | bat[buf_idx].flags = charge_state(); |
415 | #endif | 415 | #endif |
416 | buf_idx++; | 416 | buf_idx++; |
417 | #if USING_STORAGE_CALLBACK | ||
417 | rb->register_storage_idle_func(flush_buffer); | 418 | rb->register_storage_idle_func(flush_buffer); |
419 | #endif | ||
418 | } | 420 | } |
419 | 421 | ||
420 | /* What to do when the measurement buffer is full: | 422 | /* What to do when the measurement buffer is full: |
@@ -454,8 +456,12 @@ static void thread(void) | |||
454 | } | 456 | } |
455 | } | 457 | } |
456 | 458 | ||
459 | #if USING_STORAGE_CALLBACK | ||
457 | /* unregister flush callback and flush to disk */ | 460 | /* unregister flush callback and flush to disk */ |
458 | rb->unregister_storage_idle_func(flush_buffer, true); | 461 | rb->unregister_storage_idle_func(flush_buffer, true); |
462 | #else | ||
463 | flush_buffer(NULL); | ||
464 | #endif | ||
459 | 465 | ||
460 | /* log end of bench and exit reason */ | 466 | /* log end of bench and exit reason */ |
461 | fd = rb->open(BATTERY_LOG, O_RDWR | O_CREAT | O_APPEND, 0666); | 467 | fd = rb->open(BATTERY_LOG, O_RDWR | O_CREAT | O_APPEND, 0666); |