SERIAL, MUX: General fix for Windows Platform physical serial port output

Avoid Windows specific serial I/O behaviors which might not always have
hardware state reported to user level code.  The TMXR layer code already
paces mux output so that reasonable behavior is observed.
This commit is contained in:
Mark Pizzolato 2017-10-28 09:28:39 -07:00
parent d73b626719
commit cb21246f6e
2 changed files with 1 additions and 9 deletions

View file

@ -879,8 +879,6 @@ return read; /* return the number of
int32 sim_write_serial (SERHANDLE port, char *buffer, int32 count)
{
if (WaitForSingleObject (port->oWriteReady.hEvent, 0) == WAIT_TIMEOUT)
return 0;
if ((!WriteFile (port->hPort, (LPVOID) buffer, /* write the buffer to the serial port */
(DWORD) count, NULL, &port->oWriteSync)) &&
(GetLastError () != ERROR_IO_PENDING)) {
@ -888,12 +886,6 @@ if ((!WriteFile (port->hPort, (LPVOID) buffer, /* write the buffer to the seri
(int) GetLastError ());
return -1; /* return failure to caller */
}
if ((!WaitCommEvent (port->hPort, &port->dwEvtMask, &port->oWriteReady)) &&
(GetLastError () != ERROR_IO_PENDING)) {
sim_error_serial ("WaitCommEvent", /* function failed; report unexpected error */
(int) GetLastError ());
return -1; /* return failure to caller */
}
return count; /* return number of characters written/queued */
}

View file

@ -701,7 +701,7 @@ if (lp->serport) { /* serial port connectio
return 0;
written = sim_write_serial (lp->serport, &(lp->txb[i]), length);
if (written > 0)
lp->txnexttime = floor (sim_gtime () + (lp->txdelta * sim_timer_inst_per_sec ()));
lp->txnexttime = floor (sim_gtime () + (written * lp->txdelta * sim_timer_inst_per_sec ()));
return written;
}
else { /* Telnet connection */