summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-01-27 11:05:38 +0000
committerThomas Martitz <kugel@rockbox.org>2009-01-27 11:05:38 +0000
commita43b0db3d10aeb04e78494074f90b553b1a8ae59 (patch)
tree5c9e5850a3516496308ca248f4640e0bbd0b32cc
parent9d10f112994ddd3470e219175b92ab201769ba87 (diff)
downloadrockbox-a43b0db3d10aeb04e78494074f90b553b1a8ae59.tar.gz
rockbox-a43b0db3d10aeb04e78494074f90b553b1a8ae59.zip
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
-rw-r--r--apps/debug_menu.c4
-rw-r--r--firmware/SOURCES1
-rw-r--r--firmware/target/arm/as3525/debug-as3525.c49
-rw-r--r--firmware/target/arm/as3525/sansa-c200v2/debug-target.h (renamed from firmware/target/arm/as3525/debug-target.h)1
-rw-r--r--firmware/target/arm/as3525/sansa-clip/debug-target.h26
-rw-r--r--firmware/target/arm/as3525/sansa-e200v2/debug-target.h26
-rw-r--r--firmware/target/arm/as3525/sansa-fuze/button-fuze.c12
-rw-r--r--firmware/target/arm/as3525/sansa-fuze/debug-target.h28
-rw-r--r--firmware/target/arm/as3525/sansa-m200v4/debug-target.h26
9 files changed, 163 insertions, 10 deletions
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[] = {
2651 { "Dump ROM contents", dbg_save_roms }, 2651 { "Dump ROM contents", dbg_save_roms },
2652#endif 2652#endif
2653#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || defined(CPU_PP) \ 2653#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || defined(CPU_PP) \
2654 || CONFIG_CPU == S3C2440 || CONFIG_CPU == IMX31L 2654 || CONFIG_CPU == S3C2440 || CONFIG_CPU == IMX31L || CONFIG_CPU == AS3525
2655 { "View I/O ports", dbg_ports }, 2655 { "View I/O ports", dbg_ports },
2656#endif 2656#endif
2657 #if (CONFIG_RTC == RTC_PCF50605) && !defined(SIMULATOR) 2657#if (CONFIG_RTC == RTC_PCF50605) && !defined(SIMULATOR)
2658 { "View PCF registers", dbg_pcf }, 2658 { "View PCF registers", dbg_pcf },
2659#endif 2659#endif
2660#if defined(HAVE_TSC2100) && !defined(SIMULATOR) 2660#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
344#endif 344#endif
345 345
346#if CONFIG_CPU == AS3525 346#if CONFIG_CPU == AS3525
347target/arm/as3525/debug-as3525.c
347target/arm/as3525/system-as3525.c 348target/arm/as3525/system-as3525.c
348target/arm/as3525/kernel-as3525.c 349target/arm/as3525/kernel-as3525.c
349target/arm/as3525/ata_sd_as3525.c 350target/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 @@
21 21
22#include <stdbool.h> 22#include <stdbool.h>
23#include "debug-target.h" 23#include "debug-target.h"
24#include "button.h"
25#include "lcd.h"
26#include "font.h"
27#include "system.h"
28#include "sprintf.h"
29
30
31#define _DEBUG_PRINTF(a,varargs...) \
32 snprintf(buf, sizeof(buf), (a), ##varargs); lcd_puts(0,line++,buf)
24 33
25/* TODO */ 34/* TODO */
26 35
27bool __dbg_ports(void) 36bool __dbg_hw_info(void)
28{ 37{
29 return false; 38 return false;
30} 39}
31 40
32bool __dbg_hw_info(void) 41bool __dbg_ports(void)
33{ 42{
43 char buf[50];
44 int line, i;
45 char counter = 0;
46
47 lcd_clear_display();
48 lcd_setfont(FONT_SYSFIXED);
49 char gpio_data[4] = {0,0,0,0};
50
51 while(1)
52 {
53 line = 0;
54 for (i = 0; i < 8; i++)
55 {
56 gpio_data[0] |= GPIOA_PIN(i) & (1<<i);
57 gpio_data[1] |= GPIOB_PIN(i) & (1<<i);
58 gpio_data[2] |= GPIOC_PIN(i) & (1<<i);
59 gpio_data[3] |= GPIOD_PIN(i) & (1<<i);
60 }
61
62 line++;
63 _DEBUG_PRINTF("[GPIO Values and Directions]");
64 _DEBUG_PRINTF("GPIOA: %2x DIR: %2x", gpio_data[0], GPIOA_DIR);
65 _DEBUG_PRINTF("GPIOB: %2x DIR: %2x", gpio_data[1], GPIOB_DIR);
66 _DEBUG_PRINTF("GPIOC: %2x DIR: %2x", gpio_data[2], GPIOC_DIR);
67 _DEBUG_PRINTF("GPIOD: %2x DIR: %2x", gpio_data[3], GPIOD_DIR);
68 line++;
69#ifdef TRACK_DBOP_DIN
70 _DEBUG_PRINTF("[DBOP_DIN]");
71 _DEBUG_PRINTF("DBOP_DIN: %4x", _dbop_din);
72#endif
73 memset(gpio_data, 0, sizeof(gpio_data));
74 lcd_update();
75 if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
76 break;
77 }
78 lcd_setfont(FONT_UI);
34 return false; 79 return false;
35} 80}
diff --git a/firmware/target/arm/as3525/debug-target.h b/firmware/target/arm/as3525/sansa-c200v2/debug-target.h
index d3b7a28aee..0769a2f11d 100644
--- a/firmware/target/arm/as3525/debug-target.h
+++ b/firmware/target/arm/as3525/sansa-c200v2/debug-target.h
@@ -21,5 +21,6 @@
21 21
22#include <stdbool.h> 22#include <stdbool.h>
23 23
24#define DEBUG_CANCEL BUTTON_LEFT
24bool __dbg_hw_info(void); 25bool __dbg_hw_info(void);
25bool __dbg_ports(void); 26bool __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 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Karl Kurbjun
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include <stdbool.h>
23
24#define DEBUG_CANCEL BUTTON_LEFT
25bool __dbg_hw_info(void);
26bool __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 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Karl Kurbjun
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include <stdbool.h>
23
24#define DEBUG_CANCEL BUTTON_LEFT
25bool __dbg_hw_info(void);
26bool __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;
42#else 42#else
43#define hold_button false 43#define hold_button false
44#endif /* !BOOTLOADER */ 44#endif /* !BOOTLOADER */
45static int int_btn = BUTTON_NONE; 45static int int_btn = BUTTON_NONE;
46static short dbop_din = BUTTON_NONE; 46short _dbop_din = BUTTON_NONE;
47 47
48void button_init_device(void) 48void button_init_device(void)
49{ 49{
@@ -76,7 +76,7 @@ static void get_wheel(void)
76 { 2, 0, 3, 1 }, /* Clockwise rotation */ 76 { 2, 0, 3, 1 }, /* Clockwise rotation */
77 { 1, 3, 0, 2 }, /* Counter-clockwise */ 77 { 1, 3, 0, 2 }, /* Counter-clockwise */
78 }; 78 };
79 wheel_value = dbop_din & (1<<13|1<<14); 79 wheel_value = _dbop_din & (1<<13|1<<14);
80 wheel_value >>= 13; 80 wheel_value >>= 13;
81 /* did the wheel value change? */ 81 /* did the wheel value change? */
82 if (!hold_button) 82 if (!hold_button)
@@ -130,7 +130,7 @@ static void get_wheel(void)
130/* get hold button state */ 130/* get hold button state */
131static void get_hold(void) 131static void get_hold(void)
132{ 132{
133 hold_button = dbop_din & (1<<12); 133 hold_button = _dbop_din & (1<<12);
134} 134}
135#endif 135#endif
136 136
@@ -141,7 +141,7 @@ bool button_hold(void)
141 141
142static void get_power(void) 142static void get_power(void)
143{ 143{
144 if (dbop_din & (1<<8)) 144 if (_dbop_din & (1<<8))
145 int_btn |= BUTTON_POWER; 145 int_btn |= BUTTON_POWER;
146} 146}
147 147
@@ -172,7 +172,7 @@ static void get_button_from_dbob(void)
172 temp = DBOP_STAT; 172 temp = DBOP_STAT;
173 } while ((temp & (1<<16)) == 0); /* wait for valid data */ 173 } while ((temp & (1<<16)) == 0); /* wait for valid data */
174 174
175 dbop_din = DBOP_DIN; /* now read */ 175 _dbop_din = DBOP_DIN; /* now read */
176 176
177 DBOP_TIMPOL_01 = 0x6e167; 177 DBOP_TIMPOL_01 = 0x6e167;
178 DBOP_TIMPOL_23 = 0xa167e06f; 178 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 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Karl Kurbjun
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include <stdbool.h>
23
24#define DEBUG_CANCEL BUTTON_LEFT
25#define TRACK_DBOP_DIN
26extern short _dbop_din;
27bool __dbg_hw_info(void);
28bool __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 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Karl Kurbjun
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include <stdbool.h>
23
24#define DEBUG_CANCEL BUTTON_LEFT
25bool __dbg_hw_info(void);
26bool __dbg_ports(void);