From 23ee77475f3caf118fd955691f2244d87917dae7 Mon Sep 17 00:00:00 2001 From: Andree Buschmann Date: Sat, 19 Apr 2008 10:43:00 +0000 Subject: 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 --- apps/debug_menu.c | 12 +++++++----- 1 file 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); } -- cgit v1.1