Added gdb stub serial port setup

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@625 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2002-05-17 19:48:27 +00:00
parent 833556c2e7
commit f1afb84f9d
2 changed files with 17 additions and 0 deletions

View file

@ -27,6 +27,18 @@ char debugbuf[200];
#ifndef SIMULATOR /* allow non archos platforms to display output */ #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) static int debug_tx_ready(void)
{ {
return (SSR1 & SCI_TDRE); return (SSR1 & SCI_TDRE);
@ -189,6 +201,10 @@ void debugf(char *fmt, ...)
#else /* SIMULATOR code coming up */ #else /* SIMULATOR code coming up */
void debug_init(void)
{
}
void debugf(char *fmt, ...) void debugf(char *fmt, ...)
{ {
va_list ap; va_list ap;

View file

@ -19,6 +19,7 @@
#ifndef DEBUG_H #ifndef DEBUG_H
#define DEBUG_H #define DEBUG_H
extern void debug_init(void);
extern void debugf(char* fmt,...); extern void debugf(char* fmt,...);
#ifdef __GNUC__ #ifdef __GNUC__