From 301865c2b4342a9cad1ce81d8ff02034536cf4b1 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Sat, 14 Jan 2017 23:44:29 +0000 Subject: [PATCH] - fixed PRINT_REG_CHG git-svn-id: http://moon:8086/svn/mips@82 a8ebac50-d88d-4704-bea3-6648445a41b3 --- src/libsys/boards/denano/board.c | 10 ++++++++-- src/libsys/xcpt.h | 8 ++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/libsys/boards/denano/board.c b/src/libsys/boards/denano/board.c index b6fb7d7..e5b6fc2 100644 --- a/src/libsys/boards/denano/board.c +++ b/src/libsys/boards/denano/board.c @@ -27,6 +27,8 @@ con_if_t con_if = }; uart_if_t const *dbg_uart = NULL; +volatile uint32_t *pGpioData = (uint32_t*)SYS_GPIO_0_DATA; +volatile uint32_t *pGpioDir = (uint32_t*)SYS_GPIO_0_DIR; void dbg_uart_setup(); @@ -50,6 +52,7 @@ void board_init(void) interrupt_init(); // Do some initializations here + *pGpioDir = 0xFF; } extern void dbg_handler(struct xcptcontext * xcp); @@ -87,8 +90,11 @@ inline void _dbg_writechar(uart_if_t const *pUart, char c) inline char _dbg_readchar(uart_if_t const *pUart) { // busy read - while(!(SYS_UART_BIT_RX_AVAIL & *pUart->pCTRL)); - + while(!(SYS_UART_BIT_RX_AVAIL & *pUart->pCTRL)) + { + (*pGpioData)++; + } + (*pGpioData) = 0; return (*pUart->pDATA & 0xFF); } diff --git a/src/libsys/xcpt.h b/src/libsys/xcpt.h index fcb3120..04fcaee 100644 --- a/src/libsys/xcpt.h +++ b/src/libsys/xcpt.h @@ -43,10 +43,10 @@ typedef int (*fp_xcpt_t)(struct xcptcontext * xcp); #define PRINT_REG_CHG(tag_str, reg, reg_last) \ - dbg_puts(tag_str); \ - dbg_print_word(reg); \ - dbg_puts(reg != reg_last ? "*" : " "); \ - dbg_puts(" "); + sputs(tag_str); \ + print_word(reg); \ + sputs(reg != reg_last ? "*" : " "); \ + sputs(" "); // Public functions