summaryrefslogtreecommitdiff
path: root/firmware/target/arm/tcc780x/debug-tcc780x.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/tcc780x/debug-tcc780x.c')
-rw-r--r--firmware/target/arm/tcc780x/debug-tcc780x.c88
1 files changed, 88 insertions, 0 deletions
diff --git a/firmware/target/arm/tcc780x/debug-tcc780x.c b/firmware/target/arm/tcc780x/debug-tcc780x.c
new file mode 100644
index 0000000000..cc5716fd88
--- /dev/null
+++ b/firmware/target/arm/tcc780x/debug-tcc780x.c
@@ -0,0 +1,88 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Rob Purchase
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#include "config.h"
21#include "cpu.h"
22#include "system.h"
23#include "string.h"
24#include <stdbool.h>
25#include "button.h"
26#include "lcd.h"
27#include "sprintf.h"
28#include "font.h"
29
30bool __dbg_ports(void);
31bool __dbg_ports(void)
32{
33 return false;
34}
35
36//extern char r_buffer[5];
37//extern int r_button;
38
39bool __dbg_hw_info(void);
40bool __dbg_hw_info(void)
41{
42 int line = 0, button, oldline;
43 int *address=0x0;
44 bool done=false;
45 char buf[100];
46
47 lcd_setmargins(0, 0);
48 lcd_setfont(FONT_SYSFIXED);
49 lcd_clear_display();
50
51 /* Put all the static text before the while loop */
52 lcd_puts(0, line++, "[Hardware info]");
53
54 /* TODO: ... */
55
56 line++;
57 oldline=line;
58 while(!done)
59 {
60 line = oldline;
61 button = button_get(false);
62
63 button &= ~BUTTON_REPEAT;
64
65 if (button == BUTTON_MENU)
66 done=true;
67 if(button==BUTTON_DOWN)
68 address+=0x01;
69 else if (button==BUTTON_UP)
70 address-=0x01;
71
72 /*snprintf(buf, sizeof(buf), "Buffer: 0x%02x%02x%02x%02x%02x",
73 r_buffer[0], r_buffer[1], r_buffer[2], r_buffer[3],r_buffer[4] ); lcd_puts(0, line++, buf);
74 snprintf(buf, sizeof(buf), "Button: 0x%08x, HWread: 0x%08x",
75 (unsigned int)button, r_button); lcd_puts(0, line++, buf);*/
76 snprintf(buf, sizeof(buf), "current tick: %08x Seconds running: %08d",
77 (unsigned int)current_tick, (unsigned int)current_tick/100); lcd_puts(0, line++, buf);
78 snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x",
79 (unsigned int)address, *address); lcd_puts(0, line++, buf);
80 snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x",
81 (unsigned int)(address+1), *(address+1)); lcd_puts(0, line++, buf);
82 snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x",
83 (unsigned int)(address+2), *(address+2)); lcd_puts(0, line++, buf);
84
85 lcd_update();
86 }
87 return false;
88}