TMXR: Fix to allow serial port to operate after attach with -V
This commit is contained in:
parent
daf8382cf2
commit
1a86dfa0dd
1 changed files with 11 additions and 10 deletions
21
sim_tmxr.c
21
sim_tmxr.c
|
@ -543,11 +543,20 @@ else
|
||||||
|
|
||||||
psave = lp->txbpi; /* save insertion pointer */
|
psave = lp->txbpi; /* save insertion pointer */
|
||||||
lp->txbpi = lp->txbpr; /* insert connection message */
|
lp->txbpi = lp->txbpr; /* insert connection message */
|
||||||
|
if ((lp->serport) && (!sim_is_running)) {
|
||||||
|
sim_os_ms_sleep (TMXR_DTR_DROP_TIME); /* Wait for DTR to be noticed */
|
||||||
|
lp->ser_connect_pending = FALSE; /* Mark line as ready for action */
|
||||||
|
lp->conn = TRUE;
|
||||||
|
}
|
||||||
tmxr_linemsg (lp, msgbuf); /* beginning of buffer */
|
tmxr_linemsg (lp, msgbuf); /* beginning of buffer */
|
||||||
lp->txbpi = psave; /* restore insertion pointer */
|
lp->txbpi = psave; /* restore insertion pointer */
|
||||||
|
|
||||||
unwritten = tmxr_send_buffered_data (lp); /* send the message */
|
unwritten = tmxr_send_buffered_data (lp); /* send the message */
|
||||||
|
|
||||||
|
if ((lp->serport) && (!sim_is_running)) {
|
||||||
|
lp->ser_connect_pending = TRUE; /* Mark line as not yet ready for action */
|
||||||
|
lp->conn = FALSE;
|
||||||
|
}
|
||||||
if (unwritten == 0) /* buffer now empty? */
|
if (unwritten == 0) /* buffer now empty? */
|
||||||
lp->xmte = 1; /* reenable transmission if paused */
|
lp->xmte = 1; /* reenable transmission if paused */
|
||||||
|
|
||||||
|
@ -2723,13 +2732,9 @@ while (*tptr) {
|
||||||
if (!lp->mp->modem_control) /* raise DTR and RTS for non modem control lines */
|
if (!lp->mp->modem_control) /* raise DTR and RTS for non modem control lines */
|
||||||
sim_control_serial (lp->serport, TMXR_MDM_DTR|TMXR_MDM_RTS, 0, NULL);
|
sim_control_serial (lp->serport, TMXR_MDM_DTR|TMXR_MDM_RTS, 0, NULL);
|
||||||
lp->cnms = sim_os_msec (); /* record time of connection */
|
lp->cnms = sim_os_msec (); /* record time of connection */
|
||||||
if (sim_switches & SWMASK ('V')) { /* -V flag reports connection on port */
|
if (sim_switches & SWMASK ('V')) /* -V flag reports connection on port */
|
||||||
sim_os_ms_sleep (TMXR_DTR_DROP_TIME); /* Wait for DTR to be noticed */
|
|
||||||
lp->ser_connect_pending = FALSE; /* Mark line as ready for action */
|
|
||||||
lp->conn = TRUE;
|
|
||||||
tmxr_report_connection (mp, lp); /* report the connection to the line */
|
tmxr_report_connection (mp, lp); /* report the connection to the line */
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
lp->datagram = datagram;
|
lp->datagram = datagram;
|
||||||
if (datagram) {
|
if (datagram) {
|
||||||
|
@ -2834,13 +2839,9 @@ while (*tptr) {
|
||||||
if (!lp->mp->modem_control) /* raise DTR and RTS for non modem control lines */
|
if (!lp->mp->modem_control) /* raise DTR and RTS for non modem control lines */
|
||||||
sim_control_serial (lp->serport, TMXR_MDM_DTR|TMXR_MDM_RTS, 0, NULL);
|
sim_control_serial (lp->serport, TMXR_MDM_DTR|TMXR_MDM_RTS, 0, NULL);
|
||||||
lp->cnms = sim_os_msec (); /* record time of connection */
|
lp->cnms = sim_os_msec (); /* record time of connection */
|
||||||
if (sim_switches & SWMASK ('V')) { /* -V flag reports connection on port */
|
if (sim_switches & SWMASK ('V')) /* -V flag reports connection on port */
|
||||||
sim_os_ms_sleep (TMXR_DTR_DROP_TIME); /* Wait for DTR to be noticed */
|
|
||||||
lp->ser_connect_pending = FALSE; /* Mark line as ready for action */
|
|
||||||
lp->conn = TRUE;
|
|
||||||
tmxr_report_connection (mp, lp); /* report the connection to the line */
|
tmxr_report_connection (mp, lp); /* report the connection to the line */
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
lp->datagram = datagram;
|
lp->datagram = datagram;
|
||||||
if (datagram) {
|
if (datagram) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue