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; diff --git a/firmware/debug.h b/firmware/debug.h index f8e6496b04..6825566951 100644 --- a/firmware/debug.h +++ b/firmware/debug.h @@ -19,6 +19,7 @@ #ifndef DEBUG_H #define DEBUG_H +extern void debug_init(void); extern void debugf(char* fmt,...); #ifdef __GNUC__