From a43b0db3d10aeb04e78494074f90b553b1a8ae59 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Tue, 27 Jan 2009 11:05:38 +0000 Subject: Sansa AMS: Debug screen, shows GPIO and (on the fuze) DBOP input for now, to be extended git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19866 a1c6a512-1295-4272-9138-f99709370657 --- apps/debug_menu.c | 4 +- firmware/SOURCES | 1 + firmware/target/arm/as3525/debug-as3525.c | 49 +++++++++++++++++++++- firmware/target/arm/as3525/debug-target.h | 25 ----------- .../target/arm/as3525/sansa-c200v2/debug-target.h | 26 ++++++++++++ .../target/arm/as3525/sansa-clip/debug-target.h | 26 ++++++++++++ .../target/arm/as3525/sansa-e200v2/debug-target.h | 26 ++++++++++++ .../target/arm/as3525/sansa-fuze/button-fuze.c | 12 +++--- .../target/arm/as3525/sansa-fuze/debug-target.h | 28 +++++++++++++ .../target/arm/as3525/sansa-m200v4/debug-target.h | 26 ++++++++++++ 10 files changed, 188 insertions(+), 35 deletions(-) delete mode 100644 firmware/target/arm/as3525/debug-target.h create mode 100644 firmware/target/arm/as3525/sansa-c200v2/debug-target.h create mode 100644 firmware/target/arm/as3525/sansa-clip/debug-target.h create mode 100644 firmware/target/arm/as3525/sansa-e200v2/debug-target.h create mode 100644 firmware/target/arm/as3525/sansa-fuze/debug-target.h create mode 100644 firmware/target/arm/as3525/sansa-m200v4/debug-target.h diff --git a/apps/debug_menu.c b/apps/debug_menu.c index f613c0a18a..60f4761e94 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -2651,10 +2651,10 @@ static const struct the_menu_item menuitems[] = { { "Dump ROM contents", dbg_save_roms }, #endif #if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || defined(CPU_PP) \ - || CONFIG_CPU == S3C2440 || CONFIG_CPU == IMX31L + || CONFIG_CPU == S3C2440 || CONFIG_CPU == IMX31L || CONFIG_CPU == AS3525 { "View I/O ports", dbg_ports }, #endif - #if (CONFIG_RTC == RTC_PCF50605) && !defined(SIMULATOR) +#if (CONFIG_RTC == RTC_PCF50605) && !defined(SIMULATOR) { "View PCF registers", dbg_pcf }, #endif #if defined(HAVE_TSC2100) && !defined(SIMULATOR) diff --git a/firmware/SOURCES b/firmware/SOURCES index 46c46c2ce2..614b0e3bca 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -344,6 +344,7 @@ target/arm/pnx0101/system-pnx0101.c #endif #if CONFIG_CPU == AS3525 +target/arm/as3525/debug-as3525.c target/arm/as3525/system-as3525.c target/arm/as3525/kernel-as3525.c target/arm/as3525/ata_sd_as3525.c diff --git a/firmware/target/arm/as3525/debug-as3525.c b/firmware/target/arm/as3525/debug-as3525.c index 8a2f8838d6..a08d33e3da 100644 --- a/firmware/target/arm/as3525/debug-as3525.c +++ b/firmware/target/arm/as3525/debug-as3525.c @@ -21,15 +21,60 @@ #include #include "debug-target.h" +#include "button.h" +#include "lcd.h" +#include "font.h" +#include "system.h" +#include "sprintf.h" + + +#define _DEBUG_PRINTF(a,varargs...) \ + snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf) /* TODO */ -bool __dbg_ports(void) +bool __dbg_hw_info(void) { return false; } -bool __dbg_hw_info(void) +bool __dbg_ports(void) { + char buf[50]; + int line, i; + char counter = 0; + + lcd_clear_display(); + lcd_setfont(FONT_SYSFIXED); + char gpio_data[4] = {0,0,0,0}; + + while(1) + { + line = 0; + for (i = 0; i < 8; i++) + { + gpio_data[0] |= GPIOA_PIN(i) & (1< ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2007 by Karl Kurbjun - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ - -#include - -bool __dbg_hw_info(void); -bool __dbg_ports(void); diff --git a/firmware/target/arm/as3525/sansa-c200v2/debug-target.h b/firmware/target/arm/as3525/sansa-c200v2/debug-target.h new file mode 100644 index 0000000000..0769a2f11d --- /dev/null +++ b/firmware/target/arm/as3525/sansa-c200v2/debug-target.h @@ -0,0 +1,26 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2007 by Karl Kurbjun + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include + +#define DEBUG_CANCEL BUTTON_LEFT +bool __dbg_hw_info(void); +bool __dbg_ports(void); diff --git a/firmware/target/arm/as3525/sansa-clip/debug-target.h b/firmware/target/arm/as3525/sansa-clip/debug-target.h new file mode 100644 index 0000000000..0769a2f11d --- /dev/null +++ b/firmware/target/arm/as3525/sansa-clip/debug-target.h @@ -0,0 +1,26 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2007 by Karl Kurbjun + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include + +#define DEBUG_CANCEL BUTTON_LEFT +bool __dbg_hw_info(void); +bool __dbg_ports(void); diff --git a/firmware/target/arm/as3525/sansa-e200v2/debug-target.h b/firmware/target/arm/as3525/sansa-e200v2/debug-target.h new file mode 100644 index 0000000000..0769a2f11d --- /dev/null +++ b/firmware/target/arm/as3525/sansa-e200v2/debug-target.h @@ -0,0 +1,26 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2007 by Karl Kurbjun + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include + +#define DEBUG_CANCEL BUTTON_LEFT +bool __dbg_hw_info(void); +bool __dbg_ports(void); diff --git a/firmware/target/arm/as3525/sansa-fuze/button-fuze.c b/firmware/target/arm/as3525/sansa-fuze/button-fuze.c index ff07965f90..e52a1d37d8 100644 --- a/firmware/target/arm/as3525/sansa-fuze/button-fuze.c +++ b/firmware/target/arm/as3525/sansa-fuze/button-fuze.c @@ -42,8 +42,8 @@ static bool hold_button_old = false; #else #define hold_button false #endif /* !BOOTLOADER */ -static int int_btn = BUTTON_NONE; -static short dbop_din = BUTTON_NONE; +static int int_btn = BUTTON_NONE; +short _dbop_din = BUTTON_NONE; void button_init_device(void) { @@ -76,7 +76,7 @@ static void get_wheel(void) { 2, 0, 3, 1 }, /* Clockwise rotation */ { 1, 3, 0, 2 }, /* Counter-clockwise */ }; - wheel_value = dbop_din & (1<<13|1<<14); + wheel_value = _dbop_din & (1<<13|1<<14); wheel_value >>= 13; /* did the wheel value change? */ if (!hold_button) @@ -130,7 +130,7 @@ static void get_wheel(void) /* get hold button state */ static void get_hold(void) { - hold_button = dbop_din & (1<<12); + hold_button = _dbop_din & (1<<12); } #endif @@ -141,7 +141,7 @@ bool button_hold(void) static void get_power(void) { - if (dbop_din & (1<<8)) + if (_dbop_din & (1<<8)) int_btn |= BUTTON_POWER; } @@ -172,7 +172,7 @@ static void get_button_from_dbob(void) temp = DBOP_STAT; } while ((temp & (1<<16)) == 0); /* wait for valid data */ - dbop_din = DBOP_DIN; /* now read */ + _dbop_din = DBOP_DIN; /* now read */ DBOP_TIMPOL_01 = 0x6e167; DBOP_TIMPOL_23 = 0xa167e06f; diff --git a/firmware/target/arm/as3525/sansa-fuze/debug-target.h b/firmware/target/arm/as3525/sansa-fuze/debug-target.h new file mode 100644 index 0000000000..7ba5b2e4db --- /dev/null +++ b/firmware/target/arm/as3525/sansa-fuze/debug-target.h @@ -0,0 +1,28 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2007 by Karl Kurbjun + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include + +#define DEBUG_CANCEL BUTTON_LEFT +#define TRACK_DBOP_DIN +extern short _dbop_din; +bool __dbg_hw_info(void); +bool __dbg_ports(void); diff --git a/firmware/target/arm/as3525/sansa-m200v4/debug-target.h b/firmware/target/arm/as3525/sansa-m200v4/debug-target.h new file mode 100644 index 0000000000..0769a2f11d --- /dev/null +++ b/firmware/target/arm/as3525/sansa-m200v4/debug-target.h @@ -0,0 +1,26 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2007 by Karl Kurbjun + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include + +#define DEBUG_CANCEL BUTTON_LEFT +bool __dbg_hw_info(void); +bool __dbg_ports(void); -- cgit v1.2.3