simtrace: Add heartbeat message to debug console

This commit is contained in:
Min Xu 2014-10-25 20:13:23 +02:00 committed by Harald Welte
parent ca4e80551b
commit 7fcc62940d
3 changed files with 20 additions and 0 deletions

View File

@ -125,6 +125,14 @@ static const u_int8_t di_table[] = {
12, 20, 2, 4, 8, 16, 32, 64,
};
void iso_uart_report_overrun(void)
{
static unsigned lastOverrun = 0;
if (isoh.stats.overrun != lastOverrun) {
DEBUGPCR("UART overrun: %u", lastOverrun = isoh.stats.overrun);
}
}
void iso_uart_stats_dump(void)
{
DEBUGPCRF("no_rctx: %u, rctx_sent: %u, rst: %u, pps: %u, bytes: %u, "
@ -675,6 +683,8 @@ void iso_uart_init(void)
{
DEBUGPCR("USART Initializing");
memset(&isoh, 0, sizeof(isoh));
refill_rctx(&isoh);
/* make sure we get clock from the power management controller */

View File

@ -6,3 +6,4 @@ void iso_uart_rst(unsigned int state);
void iso_uart_rx_mode(void);
void iso_uart_clk_master(unsigned int master);
void iso_uart_init(void);
void iso_uart_report_overrun(void);

View File

@ -218,6 +218,8 @@ int _main_dbgu(char key)
void _main_func(void)
{
static unsigned loopLow = 0, loopHigh = 0;
/* first we try to get rid of pending to-be-sent stuff */
usb_out_process();
@ -225,4 +227,11 @@ void _main_func(void)
usb_in_process();
udp_unthrottle();
if ((loopLow & 0xFFFF) == 0) {
DEBUGPCR("Heart beat %08X", loopHigh++);
}
loopLow++;
iso_uart_report_overrun();
}