From ca495e63f76ae1448ca69b44df0942155ad3da89 Mon Sep 17 00:00:00 2001 From: ian Date: Mon, 14 Jul 2008 22:08:31 +0000 Subject: [PATCH] suppress output of general pings to simulation log --- hostside/realtime.c | 8 ++++++-- hostside/realtime.h | 1 + hostside/startup.c | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/hostside/realtime.c b/hostside/realtime.c index 9a73731..6a69302 100644 --- a/hostside/realtime.c +++ b/hostside/realtime.c @@ -284,6 +284,10 @@ void serial_indata_process(int buf_used) { /*---------- serial port output (not via liboop) ----------*/ void serial_transmit(const PicInsn *pi) { + serial_transmit_maybenosim(pi, 0); +} + +void serial_transmit_maybenosim(const PicInsn *pi, int nosim) { const PicInsnInfo *pii; int obj, v, suppress=0; @@ -312,11 +316,11 @@ void serial_transmit(const PicInsn *pi) { else if (pii->noiselevel > picio_send_noise) suppress= 1; else - oupicio("out",pii,obj,v,ouprintf); + oupicio("out",pii,obj,v, nosim ? ouprintf_only : ouprintf); } if (!suppress && picio_send_noise >= 2) - ouhex("picioh out", pi->d, pi->l); + (nosim ? ouhex_nosim : ouhex)("picioh out", pi->d, pi->l); /* note that the serial port is still in nonblocking mode. if * we ever buffer up far enough that the kernel wants to make us diff --git a/hostside/realtime.h b/hostside/realtime.h index 6df39a7..ca8d239 100644 --- a/hostside/realtime.h +++ b/hostside/realtime.h @@ -150,6 +150,7 @@ void ouhex(const char *word, const Byte *command, int length); void ouhex_nosim(const char *word, const Byte *command, int length); void serial_transmit(const PicInsn *pi); +void serial_transmit_maybenosim(const PicInsn *pi, int nosim); void command_doline(ParseState *ps, CommandInput *cmdi_arg); const CmdInfo *current_cmd; diff --git a/hostside/startup.c b/hostside/startup.c index 1e42ae8..1496e97 100644 --- a/hostside/startup.c +++ b/hostside/startup.c @@ -25,7 +25,7 @@ static void timedout_ping(TimeoutEvent *toev) { static void timefor_ping(TimeoutEvent *toev) { enco_pic_ping(&piob, pong_seq ^ PING_PONG_PATTERN); - serial_transmit(&piob); + serial_transmit_maybenosim(&piob, toev->pclass == toev_fast_pclass); ping_toev.callback= timedout_ping; ping_toev.pclass= "startup"; toev_start(&ping_toev); -- 2.30.2