summaryrefslogtreecommitdiffstats
path: root/firmware/debug.c
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-05-17 19:48:27 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-05-17 19:48:27 +0000
commitf1afb84f9dcd9f322a558e77717f3d98ad864568 (patch)
treef38c5c49f3017364c49bfe9045ff241c7515acdd /firmware/debug.c
parent833556c2e7683aec583d5558fee400b1c6554623 (diff)
downloadrockbox-f1afb84f9dcd9f322a558e77717f3d98ad864568.tar.gz
rockbox-f1afb84f9dcd9f322a558e77717f3d98ad864568.tar.bz2
rockbox-f1afb84f9dcd9f322a558e77717f3d98ad864568.zip
Added gdb stub serial port setup
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@625 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/debug.c')
-rw-r--r--firmware/debug.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/firmware/debug.c b/firmware/debug.c
index 42b04ba605..6c688abb06 100644
--- a/firmware/debug.c
+++ b/firmware/debug.c
@@ -27,6 +27,18 @@ char debugbuf[200];
#ifndef SIMULATOR /* allow non archos platforms to display output */
+void debug_init(void)
+{
+ /* Clear it all! */
+ SSR1 &= ~(SCI_RDRF | SCI_ORER | SCI_PER | SCI_FER);
+
+ /* This enables the serial Rx interrupt, to be able to exit into the
+ debugger when you hit CTRL-C */
+ SCR1 |= 0x40;
+ SCR1 &= ~0x80;
+ IPRE |= 0xf000; /* Set to highest priority */
+}
+
static int debug_tx_ready(void)
{
return (SSR1 & SCI_TDRE);
@@ -189,6 +201,10 @@ void debugf(char *fmt, ...)
#else /* SIMULATOR code coming up */
+void debug_init(void)
+{
+}
+
void debugf(char *fmt, ...)
{
va_list ap;