From f5cd5439f516fec8862ca173e8541ab2a53bdadc Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Fri, 20 Feb 2015 16:20:18 -0800 Subject: [PATCH] FRONTPANEL: Minimuze the latency for register content queries by coalescing all response data into a single response packet. --- sim_console.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sim_console.c b/sim_console.c index 7db30823..cdc6bebe 100644 --- a/sim_console.c +++ b/sim_console.c @@ -639,11 +639,13 @@ if (sim_log) { cbuf[sizeof(cbuf)-1] = '\0'; while (fgets (cbuf, sizeof(cbuf)-1, sim_log)) tmxr_linemsgf (lp, "%s", cbuf); - do { - unwritten = tmxr_send_buffered_data (lp); - if (unwritten == lp->txbsz) - sim_os_ms_sleep (100); - } while (unwritten == lp->txbsz); + if (!tmxr_input_pending_ln (lp)) { + do { + unwritten = tmxr_send_buffered_data (lp); + if (unwritten == lp->txbsz) + sim_os_ms_sleep (100); + } while (unwritten == lp->txbsz); + } } }