From 59bfff4bfdc0613b2f2a4a0a0d1f9235c5a5c286 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sat, 5 Jan 2019 07:38:02 -0800 Subject: [PATCH] TMXR: Make sure to only set UNIT_TM_POLL flag for active tmxr units. The effect here is to avoid clearing the UNIT_TM_POLL flag for devices which call tmxr_set_line_unit or tmxr_set_line_output_unit on device reset. As reported in #646 --- sim_tmxr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sim_tmxr.c b/sim_tmxr.c index 411385af..ef533551 100644 --- a/sim_tmxr.c +++ b/sim_tmxr.c @@ -3130,7 +3130,8 @@ if ((line < 0) || (line >= mp->lines)) if (mp->ldsc[line].uptr) mp->ldsc[line].uptr->dynflags &= ~UNIT_TM_POLL; mp->ldsc[line].uptr = uptr_poll; -mp->ldsc[line].uptr->dynflags |= UNIT_TM_POLL; +if (uptr_poll->tmxr) /* associated with a TMXR? */ + mp->ldsc[line].uptr->dynflags |= UNIT_TM_POLL; return SCPE_OK; } @@ -3164,7 +3165,8 @@ if ((line < 0) || (line >= mp->lines)) if (mp->ldsc[line].o_uptr) mp->ldsc[line].o_uptr->dynflags &= ~UNIT_TM_POLL; mp->ldsc[line].o_uptr = uptr_poll; -mp->ldsc[line].o_uptr->dynflags |= UNIT_TM_POLL; +if (uptr_poll->tmxr) /* associated with a TMXR? */ + mp->ldsc[line].o_uptr->dynflags |= UNIT_TM_POLL; return SCPE_OK; }