From f2e4fcbb0fc8c149d335a63ef58e9b81a9ea1def Mon Sep 17 00:00:00 2001 From: ian Date: Sun, 18 May 2008 19:03:21 +0000 Subject: [PATCH] spot loopbacks; better death recursion discovery --- hostside/realtime.c | 5 ++++- hostside/startup.c | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hostside/realtime.c b/hostside/realtime.c index 8b246c8..1dd2f41 100644 --- a/hostside/realtime.c +++ b/hostside/realtime.c @@ -202,7 +202,10 @@ void ouhexi(const char *word, const Byte *command, int length) { } void die_vprintf_hook(const char *fmt, va_list al) { - if (events) { events=0; ovprintf(UPO, fmt, al); } + static int recursing; + if (!recursing++) + ovprintf(UPO, fmt, al); + recursing--; } void die_hook(void) { diff --git a/hostside/startup.c b/hostside/startup.c index 275941c..db87def 100644 --- a/hostside/startup.c +++ b/hostside/startup.c @@ -246,8 +246,11 @@ void on_pic_pong(const PicInsnInfo *pii, const PicInsn *pi, int objnum) { if (sta_state == Sta_Manual) return; - if (objnum != pong_seq) - die("PIC sent wrong ping response (0x%x, wanted 0x%x)", objnum, pong_seq); + if (objnum != pong_seq) { + if (objnum == (pong_seq^PING_PONG_PATTERN)) + die("PIC connection is looped back (ping %#05x bounced)", objnum); + die("PIC sent wrong ping response (%#05x, wanted %#05x)", objnum, pong_seq); + } ping_toev.duration= 1000; ping_toev.callback= timefor_ping; -- 2.30.2