From 1a48c543d5c3b07a7b8d7f97e7ab14fb8c61e356 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Wed, 10 Apr 2019 15:08:49 -0700 Subject: [PATCH] TMXR: Fix tmxr_rqln() when speeds are enabled to avoid aways ready condition. --- sim_tmxr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sim_tmxr.c b/sim_tmxr.c index 51125db2..bbd70622 100644 --- a/sim_tmxr.c +++ b/sim_tmxr.c @@ -2125,23 +2125,23 @@ for (i = 0; i < mp->lines; i++) { /* loop thru lines */ } -int32 tmxr_rqln_bare (const TMLN *lp, t_bool speed) +static int32 tmxr_rqln_bare (const TMLN *lp, t_bool speed) { if (speed) { if (lp->send.extoff < lp->send.insoff) {/* buffered SEND data? */ - if (sim_gtime () < lp->send.next_time) + if (sim_gtime () < lp->send.next_time) /* too soon? */ return 0; else - return lp->send.delay ? 1 : (lp->send.insoff - lp->send.extoff); + return 1; } if (lp->rxbps) { /* consider speed and rate limiting? */ if (sim_gtime () < lp->rxnexttime) /* too soon? */ return 0; else - return 1; + return ((lp->rxbpi - lp->rxbpr + ((lp->rxbpi < lp->rxbpr)? lp->rxbsz : 0)) > 0) ? 1 : 0; } } -return (lp->rxbpi - lp->rxbpr + ((lp->rxbpi < lp->rxbpr)? lp->rxbsz: 0)); +return (lp->rxbpi - lp->rxbpr + ((lp->rxbpi < lp->rxbpr)? lp->rxbsz : 0)); } /* Return count of available characters ready to be read for line */