FS#8961 - Anti-Aliased Fonts.
[kugel-rb.git] / firmware / target / arm / tcc77x / debug-tcc77x.c
blob203a6010ce01896dab7ceda2252719777b7f6f0e
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2007 by Rob Purchase
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #include "config.h"
23 #include "cpu.h"
24 #include "system.h"
25 #include "string.h"
26 #include <stdbool.h>
27 #include "button.h"
28 #include "lcd.h"
29 #include "sprintf.h"
30 #include "font.h"
31 #include "debug-target.h"
32 #include "adc.h"
34 bool __dbg_ports(void)
36 return false;
39 bool __dbg_hw_info(void)
41 int line = 0, i, button, oldline;
42 bool done=false;
43 char buf[100];
45 lcd_setfont(FONT_SYSFIXED);
46 lcd_clear_display();
48 /* Put all the static text before the while loop */
49 lcd_puts(0, line++, "[Hardware info]");
51 line++;
52 oldline=line;
53 while(!done)
55 line = oldline;
56 button = button_get(false);
58 button &= ~BUTTON_REPEAT;
59 #ifdef BUTTON_SELECT
60 if (button == BUTTON_SELECT)
61 #else
62 if (button == BUTTON_STOP)
63 #endif
64 done=true;
66 snprintf(buf, sizeof(buf), "current tick: %08x Seconds running: %08d",
67 (unsigned int)current_tick, (unsigned int)current_tick/100); lcd_puts(0, line++, buf);
69 snprintf(buf, sizeof(buf), "GPIOA: 0x%08x GPIOB: 0x%08x",
70 (unsigned int)GPIOA, (unsigned int)GPIOB); lcd_puts(0, line++, buf);
71 snprintf(buf, sizeof(buf), "GPIOC: 0x%08x GPIOD: 0x%08x",
72 (unsigned int)GPIOC, (unsigned int)GPIOD); lcd_puts(0, line++, buf);
73 snprintf(buf, sizeof(buf), "GPIOE: 0x%08x",
74 (unsigned int)GPIOE); lcd_puts(0, line++, buf);
76 for (i = 0; i<4; i++)
78 snprintf(buf, sizeof(buf), "ADC%d: 0x%04x", i, adc_read(i));
79 lcd_puts(0, line++, buf);
82 lcd_update();
84 return false;