From 794c9684307ecab734e24d7f41e8ec5954dd0cd3 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Fri, 27 Jul 2007 22:34:15 +0000 Subject: Make 'View HW Info' work on PP5002 targets and move clock estimation there. * Shorter way to write the wait for userabort. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14031 a1c6a512-1295-4272-9138-f99709370657 --- apps/debug_menu.c | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) (limited to 'apps/debug_menu.c') diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 4e35404..d1e1b86 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -562,11 +562,8 @@ static bool dbg_hw_info(void) lcd_update(); - while(1) - { - if (action_userabort(TIMEOUT_BLOCK)) - return false; - } + while (!(action_userabort(TIMEOUT_BLOCK))); + #elif CONFIG_CPU == MCF5249 || CONFIG_CPU == MCF5250 char buf[32]; unsigned manu, id; /* flash IDs */ @@ -624,11 +621,8 @@ static bool dbg_hw_info(void) lcd_update(); - while(1) - { - if (action_userabort(TIMEOUT_BLOCK)) - return false; - } + while (!(action_userabort(TIMEOUT_BLOCK))); + #elif defined(CPU_PP502x) int line = 0; char buf[32]; @@ -663,11 +657,30 @@ static bool dbg_hw_info(void) lcd_update(); - while(1) - { - if (action_userabort(TIMEOUT_BLOCK)) - return false; - } + while (!(action_userabort(TIMEOUT_BLOCK))); + +#elif CONFIG_CPU == PP5002 + int line = 0; + char buf[32]; + + lcd_setmargins(0, 0); + lcd_setfont(FONT_SYSFIXED); + lcd_clear_display(); + + lcd_puts(0, line++, "[Hardware info]"); + +#ifdef IPOD_ARCH + snprintf(buf, sizeof(buf), "HW rev: 0x%08lx", IPOD_HW_REVISION); + lcd_puts(0, line++, buf); +#endif + + snprintf(buf, sizeof(buf), "Est. clock (kHz): %d", perfcheck()); + lcd_puts(0, line++, buf); + + lcd_update(); + + while (!(action_userabort(TIMEOUT_BLOCK))); + #endif /* CONFIG_CPU */ return false; } @@ -1275,8 +1288,6 @@ bool dbg_ports(void) lcd_puts(0, line++, buf); snprintf(buf, sizeof(buf), "TIMING2_CTL: %08lx", TIMING2_CTL); lcd_puts(0, line++, buf); - snprintf(buf, sizeof(buf), "Est. clock (kHz): %d", perfcheck()); - lcd_puts(0, line++, buf); lcd_update(); if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) -- cgit v1.1