/* * 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 #include #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) { }