- fixed PRINT_REG_CHG
git-svn-id: http://moon:8086/svn/mips@82 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
+4
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user