H316: Call the host interface TX service routine.

The modem and host interface TX services should both be called from
the RTC device, but when the host interface was implemented the call
was not added.
This commit is contained in:
Lars Brinkhoff 2021-10-20 12:58:50 +02:00
parent 5dcc00ea10
commit 1e4401fd84
3 changed files with 5 additions and 8 deletions

View file

@ -349,14 +349,9 @@ void hi_start_tx (uint16 line, uint16 flags)
if (ret != SCPE_OK && ret != 66) hi_link_error(line); if (ret != SCPE_OK && ret != 66) hi_link_error(line);
} }
// XXX the host interface is significantly faster... Need new math here. // Do some fancy math to figure out how long, in RTC ticks, it would actually
// 1822 pg 4-9 100 KBS // take to transmit a message of this length with a real host interface.
nbits = ((uint32) count)*16UL;
// Do some fancy math to figure out how long, in RTC ticks, it would actually
// take to transmit a packet of this length with a real modem and phone line.
// Note that the "+12" is an approximation for the modem overhead, including
// DLE, STX, ETX and checksum bytes, that would be added to the packet.
nbits = (((uint32) count)*2UL + 12UL) * 8UL;
PHIDB(line)->txdelay = (nbits * 1000000UL) / (PHIDB(line)->bps * rtc_interval); PHIDB(line)->txdelay = (nbits * 1000000UL) / (PHIDB(line)->bps * rtc_interval);
sim_debug(IMP_DBG_IOT, PDEVICE(line), "HI%d - transmit packet, length=%d, bits=%u, interval=%u, delay=%u\n", line, count, nbits, rtc_interval, PHIDB(line)->txdelay); sim_debug(IMP_DBG_IOT, PDEVICE(line), "HI%d - transmit packet, length=%d, bits=%u, interval=%u, delay=%u\n", line, count, nbits, rtc_interval, PHIDB(line)->txdelay);
// That's it - we're done until it's time for the TX done interrupt ... // That's it - we're done until it's time for the TX done interrupt ...

View file

@ -206,6 +206,7 @@ typedef struct _HIDB HIDB;
// modem transmitter timing exactly right! // modem transmitter timing exactly right!
extern uint32 rtc_interval; extern uint32 rtc_interval;
extern t_stat mi_tx_service (uint32 quantum); extern t_stat mi_tx_service (uint32 quantum);
extern t_stat hi_tx_service (uint32 quantum);
// Prototypes for UDP modem/host interface emulation routines ... // Prototypes for UDP modem/host interface emulation routines ...
#define NOLINK (-1) #define NOLINK (-1)

View file

@ -245,6 +245,7 @@ t_stat rtc_service (UNIT *uptr)
SET_RTC_IRQ(); SET_RTC_IRQ();
} }
mi_tx_service(rtc_quantum); mi_tx_service(rtc_quantum);
hi_tx_service(rtc_quantum);
uptr->wait = sim_rtc_calb (rtc_tps); /* recalibrate */ uptr->wait = sim_rtc_calb (rtc_tps); /* recalibrate */
sim_activate_after (uptr, 1000000/rtc_tps); /* reactivate unit */ sim_activate_after (uptr, 1000000/rtc_tps); /* reactivate unit */
return SCPE_OK; return SCPE_OK;