1
0
mirror of https://github.com/rcornwell/sims.git synced 2026-05-03 14:40:12 +00:00

I7000: Fixed COM device to work correctly.

This commit is contained in:
Richard Cornwell
2016-06-09 22:46:07 -04:00
parent e06c06bf29
commit d7be310574
2 changed files with 3 additions and 17 deletions

View File

@@ -69,20 +69,13 @@ chan_set_devs(DEVICE * dptr)
for (num = sim_devices[i]->numunits; num > 0; num--) for (num = sim_devices[i]->numunits; num > 0; num--)
(uptr++)->flags |= UNIT_DIS; (uptr++)->flags |= UNIT_DIS;
goto nextdev; goto nextdev;
} else {
/* Set type to highest found */
for(type = 7; type >=0; type--)
if (ctype >> type)
break;
chan_unit[chan].flags &= ~(CHAN_MODEL);
chan_unit[chan].flags |= CHAN_S_TYPE(type)|CHAN_SET;
} }
} }
/* Set channel to highest type */ /* Set channel to highest type */
if ((chan_unit[chan].flags & CHAN_SET) == 0) { if ((chan_unit[chan].flags & CHAN_SET) == 0) {
/* Set type to highest found */ /* Set type to highest found */
for(type = 7; type >=0; type--) for(type = 7; type >=0; type--)
if (ctype >> type) if (ctype & (1 << type))
break; break;
chan_unit[chan].flags &= ~(CHAN_MODEL); chan_unit[chan].flags &= ~(CHAN_MODEL);
chan_unit[chan].flags |= CHAN_S_TYPE(type)|CHAN_SET; chan_unit[chan].flags |= CHAN_S_TYPE(type)|CHAN_SET;
@@ -109,20 +102,13 @@ chan_set_devs(DEVICE * dptr)
&& num_devs[chan] != 0)) { && num_devs[chan] != 0)) {
uptr->flags |= UNIT_DIS; uptr->flags |= UNIT_DIS;
goto next; goto next;
} else {
/* Set type to highest found */
for(type = 7; type >= 0; type--)
if (ctype >> type)
break;
chan_unit[chan].flags &= ~(CHAN_MODEL);
chan_unit[chan].flags |= CHAN_S_TYPE(type)|CHAN_SET;
} }
} }
/* Set channel to highest type */ /* Set channel to highest type */
if ((chan_unit[chan].flags & CHAN_SET) == 0) { if ((chan_unit[chan].flags & CHAN_SET) == 0) {
/* Set type to highest found */ /* Set type to highest found */
for(type = 7; type >=0; type--) for(type = 7; type >=0; type--)
if (ctype >> type) if (ctype & (1 << type))
break; break;
chan_unit[chan].flags &= ~(CHAN_MODEL); chan_unit[chan].flags &= ~(CHAN_MODEL);
chan_unit[chan].flags |= CHAN_S_TYPE(type)|CHAN_SET; chan_unit[chan].flags |= CHAN_S_TYPE(type)|CHAN_SET;

View File

@@ -328,7 +328,7 @@ DEVICE com_dev = {
3, 10, 31, 1, 16, 8, 3, 10, 31, 1, 16, 8,
&tmxr_ex, &tmxr_dep, &com_reset, &tmxr_ex, &tmxr_dep, &com_reset,
NULL, &com_attach, &com_detach, NULL, &com_attach, &com_detach,
&com_dib, DEV_DIS | DEV_DISABLE| DEV_DEBUG|DEV_NET, 0, dev_debug, &com_dib, DEV_DISABLE| DEV_DEBUG|DEV_NET, 0, dev_debug,
NULL, NULL, &com_help, NULL, NULL, &com_description NULL, NULL, &com_help, NULL, NULL, &com_description
}; };