summaryrefslogtreecommitdiff
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
authorAndree Buschmann <AndreeBuschmann@t-online.de>2008-04-19 10:43:00 +0000
committerAndree Buschmann <AndreeBuschmann@t-online.de>2008-04-19 10:43:00 +0000
commit23ee77475f3caf118fd955691f2244d87917dae7 (patch)
tree6bbeb974bf2d38c2cac135af1da5269524337653 /apps/debug_menu.c
parent1928ecf6d6d96a4f49b0222d807852915bf07b3c (diff)
downloadrockbox-23ee77475f3caf118fd955691f2244d87917dae7.zip
rockbox-23ee77475f3caf118fd955691f2244d87917dae7.tar.gz
rockbox-23ee77475f3caf118fd955691f2244d87917dae7.tar.bz2
rockbox-23ee77475f3caf118fd955691f2244d87917dae7.tar.xz
Small changes to debug menu: Higher precision when showing boost ratio. Added average CPU clock [MHz].
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17165 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r--apps/debug_menu.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 55a4dfd..b974bdf 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -270,7 +270,7 @@ static bool dbg_audio_thread(void)
extern size_t filebuflen;
/* This is a size_t, but call it a long so it puts a - when it's bad. */
-static unsigned int ticks, boost_ticks;
+static unsigned int ticks, boost_ticks, freq_sum;
static void dbg_audio_task(void)
{
@@ -278,7 +278,7 @@ static void dbg_audio_task(void)
if(FREQ > CPUFREQ_NORMAL)
boost_ticks++;
#endif
-
+ freq_sum += FREQ/1000000; /* in MHz */
ticks++;
}
@@ -293,7 +293,7 @@ static bool dbg_buffering_thread(void)
int pcmbufdescs = pcmbuf_descs();
struct buffering_debug d;
- ticks = boost_ticks = 0;
+ ticks = boost_ticks = freq_sum = 0;
tick_add_task(dbg_audio_task);
@@ -374,8 +374,10 @@ static bool dbg_buffering_thread(void)
if (ticks > 0)
{
- snprintf(buf, sizeof(buf), "boost ratio: %3d%%",
- boost_ticks * 100 / ticks);
+ int boostquota = boost_ticks * 1000 / ticks; /* in °/oo */
+ int avgclock = freq_sum * 10 / ticks; /* in 100 kHz */
+ snprintf(buf, sizeof(buf), "boost ratio: %3d.%d%% (%2d.%dMHz)",
+ boostquota/10, boostquota%10, avgclock/10, avgclock%10);
lcd_puts(0, line++, buf);
}