From 0082da7515e85a24887f0c9222958d9aafd432d1 Mon Sep 17 00:00:00 2001 From: Karl Kurbjun Date: Sat, 10 Nov 2007 22:16:15 +0000 Subject: Add some forgotten files git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15561 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/tms320dm320/debug-dm320.c | 71 ++++++++++++++++++++++++++ firmware/target/arm/tms320dm320/debug-target.h | 20 ++++++++ 2 files changed, 91 insertions(+) create mode 100755 firmware/target/arm/tms320dm320/debug-dm320.c create mode 100755 firmware/target/arm/tms320dm320/debug-target.h (limited to 'firmware') diff --git a/firmware/target/arm/tms320dm320/debug-dm320.c b/firmware/target/arm/tms320dm320/debug-dm320.c new file mode 100755 index 0000000000..d2dce118c5 --- /dev/null +++ b/firmware/target/arm/tms320dm320/debug-dm320.c @@ -0,0 +1,71 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2007 by Karl Kurbjun + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include "config.h" +#include "cpu.h" +#include "system.h" +#include "string.h" +#include +#include "button.h" +#include "lcd.h" +#include "sprintf.h" +#include "font.h" +#include "debug-target.h" + +bool __dbg_hw_info(void) +{ + 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) + { + line = 0; + 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); + + lcd_update(); + } + return false; +} diff --git a/firmware/target/arm/tms320dm320/debug-target.h b/firmware/target/arm/tms320dm320/debug-target.h new file mode 100755 index 0000000000..3c34c3125e --- /dev/null +++ b/firmware/target/arm/tms320dm320/debug-target.h @@ -0,0 +1,20 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2007 by Karl Kurbjun + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +bool __dbg_hw_info(void); -- cgit v1.2.3