Files
mips/src/bootloader/boards/denano/board.c
T
jens ff2b7a10c7 - conditional inclusion of debugger
- improved linker script


git-svn-id: http://moon:8086/svn/mips@116 a8ebac50-d88d-4704-bea3-6648445a41b3
2017-01-21 21:46:54 +00:00

57 lines
1021 B
C

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
#include <stddef.h>
#include <board.h>
#include "../../../libsys/uart.h"
#include "../../../libsys/irq.h"
#include "../../../libsys/uart.h"
#ifdef WITH_DEBUGGER
extern uart_if_t uart_if[];
extern void handle_exception (unsigned long *registers);
extern int dbg_stub(struct xcptcontext * xcp) __attribute__ ((section (".dbg_stub"))) __attribute__ ((used));
int dbg_stub(struct xcptcontext * xcp)
{
#ifdef WITH_GDB_STUB
handle_exception((unsigned long *)xcp);
return 0;
#else
return dbg_handler(xcp);
#endif
}
void dbg_putchar(char c)
{
if (c == 0x0A)
{
UART_writechar(&uart_if[UART_DEBUGGER], 0x0D);
}
UART_writechar(&uart_if[UART_DEBUGGER], c);
}
char dbg_getchar()
{
int c;
// busy read
do
{
c = UART_readchar(&uart_if[UART_DEBUGGER]);
} while(c < 0);
return (char)c;
}
#endif
void board_init(void)
{
}