diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/debug.c | 16 | ||||
-rw-r--r-- | firmware/debug.h | 1 |
2 files changed, 17 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]; | |||
27 | 27 | ||
28 | #ifndef SIMULATOR /* allow non archos platforms to display output */ | 28 | #ifndef SIMULATOR /* allow non archos platforms to display output */ |
29 | 29 | ||
30 | void debug_init(void) | ||
31 | { | ||
32 | /* Clear it all! */ | ||
33 | SSR1 &= ~(SCI_RDRF | SCI_ORER | SCI_PER | SCI_FER); | ||
34 | |||
35 | /* This enables the serial Rx interrupt, to be able to exit into the | ||
36 | debugger when you hit CTRL-C */ | ||
37 | SCR1 |= 0x40; | ||
38 | SCR1 &= ~0x80; | ||
39 | IPRE |= 0xf000; /* Set to highest priority */ | ||
40 | } | ||
41 | |||
30 | static int debug_tx_ready(void) | 42 | static int debug_tx_ready(void) |
31 | { | 43 | { |
32 | return (SSR1 & SCI_TDRE); | 44 | return (SSR1 & SCI_TDRE); |
@@ -189,6 +201,10 @@ void debugf(char *fmt, ...) | |||
189 | 201 | ||
190 | #else /* SIMULATOR code coming up */ | 202 | #else /* SIMULATOR code coming up */ |
191 | 203 | ||
204 | void debug_init(void) | ||
205 | { | ||
206 | } | ||
207 | |||
192 | void debugf(char *fmt, ...) | 208 | void debugf(char *fmt, ...) |
193 | { | 209 | { |
194 | va_list ap; | 210 | 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 @@ | |||
19 | #ifndef DEBUG_H | 19 | #ifndef DEBUG_H |
20 | #define DEBUG_H | 20 | #define DEBUG_H |
21 | 21 | ||
22 | extern void debug_init(void); | ||
22 | extern void debugf(char* fmt,...); | 23 | extern void debugf(char* fmt,...); |
23 | 24 | ||
24 | #ifdef __GNUC__ | 25 | #ifdef __GNUC__ |