TMXR: Use single character output buffer when writing to physical serial ports

This commit is contained in:
Mark Pizzolato 2016-06-11 08:28:28 -07:00
parent 82b12084b0
commit 1c551b7b5a
2 changed files with 3 additions and 2 deletions

View file

@ -439,6 +439,8 @@ static u_char mantra[] = { /* Telnet Option Negotiation Mantra
TN_IAC, TN_DO, TN_BIN TN_IAC, TN_DO, TN_BIN
}; };
#define TMXR_GUARD ((int32)(lp->serport ? 0 : sizeof(mantra)))/* buffer guard */
/* Local routines */ /* Local routines */
static void tmxr_add_to_open_list (TMXR* mux); static void tmxr_add_to_open_list (TMXR* mux);
@ -2027,7 +2029,7 @@ if ((lp->conn == FALSE) && /* no conn & not buffere
return SCPE_LOST; return SCPE_LOST;
} }
tmxr_debug_trace_line (lp, "tmxr_putc_ln()"); tmxr_debug_trace_line (lp, "tmxr_putc_ln()");
#define TXBUF_AVAIL(lp) (lp->txbsz - tmxr_tqln (lp)) #define TXBUF_AVAIL(lp) ((lp->serport ? 1: lp->txbsz) - tmxr_tqln (lp))
#define TXBUF_CHAR(lp, c) { \ #define TXBUF_CHAR(lp, c) { \
lp->txb[lp->txbpi++] = (char)(c); \ lp->txb[lp->txbpi++] = (char)(c); \
lp->txbpi %= lp->txbsz; \ lp->txbpi %= lp->txbsz; \

View file

@ -65,7 +65,6 @@ typedef int SERHANDLE;
#define TMXR_V_VALID 15 #define TMXR_V_VALID 15
#define TMXR_VALID (1 << TMXR_V_VALID) #define TMXR_VALID (1 << TMXR_V_VALID)
#define TMXR_MAXBUF 256 /* buffer size */ #define TMXR_MAXBUF 256 /* buffer size */
#define TMXR_GUARD 12 /* buffer guard */
#define TMXR_DTR_DROP_TIME 500 /* milliseconds to drop DTR for 'pseudo' modem control */ #define TMXR_DTR_DROP_TIME 500 /* milliseconds to drop DTR for 'pseudo' modem control */
#define TMXR_MODEM_RING_TIME 3 /* seconds to wait for DTR for incoming connections */ #define TMXR_MODEM_RING_TIME 3 /* seconds to wait for DTR for incoming connections */