summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2008-09-22 19:59:00 +0000
committerFrank Gevaerts <frank@gevaerts.be>2008-09-22 19:59:00 +0000
commit0a1d3653bdd016493189e6cc4e318d2a5cdd77a8 (patch)
treebafd159cf178f7754d6c4d65b212ef8ff5cfabb9
parent726a63f309b553fec16de4e856ea71575498e3f4 (diff)
downloadrockbox-0a1d3653bdd016493189e6cc4e318d2a5cdd77a8.zip
rockbox-0a1d3653bdd016493189e6cc4e318d2a5cdd77a8.tar.gz
rockbox-0a1d3653bdd016493189e6cc4e318d2a5cdd77a8.tar.bz2
rockbox-0a1d3653bdd016493189e6cc4e318d2a5cdd77a8.tar.xz
Add player name and rockbox version to the battery_bench output
This need appsversion in plugin_api git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18569 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugin.c2
-rw-r--r--apps/plugin.h1
-rw-r--r--apps/plugins/battery_bench.c13
3 files changed, 14 insertions, 2 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index aa24b32..6ef8623 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -37,6 +37,7 @@
#include "logf.h"
#include "option_select.h"
#include "talk.h"
+#include "version.h"
#if CONFIG_CHARGING
#include "power.h"
@@ -616,6 +617,7 @@ static const struct plugin_api rockbox_api = {
event_wait,
event_set_state,
#endif
+ appsversion,
/* new stuff at the end, sort into place next time
the API gets incompatible */
diff --git a/apps/plugin.h b/apps/plugin.h
index c6d2583..409108d 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -774,6 +774,7 @@ struct plugin_api {
void (*event_set_state)(struct event *e, unsigned int state);
#endif
+ const char *appsversion;
/* new stuff at the end, sort into place next time
the API gets incompatible */
diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c
index 44e7ad7..abcd962 100644
--- a/apps/plugins/battery_bench.c
+++ b/apps/plugins/battery_bench.c
@@ -21,6 +21,7 @@
****************************************************************************/
#ifndef SIMULATOR /* not for the simulator */
+#include "version.h"
#include "plugin.h"
PLUGIN_HEADER
@@ -483,7 +484,12 @@ int main(void)
"logging activity will end.\n\n"
"P.S: You can decide how you will make your tests.\n"
"Just don't open another plugin to be sure that your log "
- "will continue.\n\n"
+ "will continue.\n\n",BATTERY_LOG);
+ rb->fdprintf(fd,
+ "Battery bench run for %s version %s\n\n"
+ ,MODEL_NAME,rb->appsversion);
+
+ rb->fdprintf(fd,
"Battery type: %d mAh Buffer Entries: %d\n"
" Time:, Seconds:, Level:, Time Left:, Voltage[mV]:"
#if CONFIG_CHARGING
@@ -496,7 +502,7 @@ int main(void)
", U:"
#endif
"\n"
- ,BATTERY_LOG,rb->global_settings->battery_capacity,
+ ,rb->global_settings->battery_capacity,
(int)BUF_ELEMENTS);
rb->close(fd);
}
@@ -511,6 +517,9 @@ int main(void)
rb->close(fd);
fd = rb->open(BATTERY_LOG, O_RDWR | O_APPEND);
rb->fdprintf(fd, "\n--File already present. Resuming Benchmark--\n");
+ rb->fdprintf(fd,
+ "Battery bench run for %s version %s\n\n"
+ ,MODEL_NAME,rb->appsversion);
rb->close(fd);
}