From d3c0a7f1692fd0b367a915a8f3a7144aaebb44a7 Mon Sep 17 00:00:00 2001 From: Karl Kurbjun Date: Sat, 10 Nov 2007 22:12:54 +0000 Subject: Change the way the UART recieves data and how buttons pressed are processed. Also move some of the debug menu into the target tree and allow rockblox to build when the screen is rotated. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15560 a1c6a512-1295-4272-9138-f99709370657 --- apps/debug_menu.c | 46 +++++++--------------------------------------- 1 file changed, 7 insertions(+), 39 deletions(-) (limited to 'apps/debug_menu.c') diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 918a969..576d01d 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -88,6 +88,10 @@ #endif #include "hwcompat.h" +#if CONFIG_CPU == DM320 +#include "debug-target.h" +#endif + /*---------------------------------------------------*/ /* SPECIAL DEBUG STUFF */ /*---------------------------------------------------*/ @@ -656,45 +660,9 @@ static bool dbg_hw_info(void) lcd_update(); while (!(action_userabort(TIMEOUT_BLOCK))); -#elif CONFIG_CPU == DM320 - int line = 0, button; - int *address=0x0; - bool done=false; - char buf[100]; - - lcd_setmargins(0, 0); - lcd_setfont(FONT_SYSFIXED); - lcd_clear_display(); - lcd_puts(0, line++, "[Hardware info]"); - - while(!done) - { - button = button_get(false); - button&=~BUTTON_REPEAT; - if (button == BUTTON_POWER) - done=true; - if(button==BUTTON_RC_PLAY) - address+=0x01; - else if (button==BUTTON_RC_DOWN) - address-=0x01; - else if (button==BUTTON_RC_FF) - address+=0x800; - else if (button==BUTTON_RC_REW) - address-=0x800; - { - snprintf(buf, sizeof(buf), "current tick: %04x", (unsigned int)current_tick); - lcd_puts(0, line++, buf); - snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x", (unsigned int)address, *address); - lcd_puts(0, line++, buf); - snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x", (unsigned int)(address+1), *(address+1)); - lcd_puts(0, line++, buf); - snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x", (unsigned int)(address+2), *(address+2)); - lcd_puts(0, line++, buf); - line -= 4; - } - lcd_update(); - } - +#else + /* Define this function in your target tree */ + return __dbg_hw_info(); #endif /* CONFIG_CPU */ return false; } -- cgit v1.1