From 88cf18bfcf0514071273bc5d357c0526c51a3195 Mon Sep 17 00:00:00 2001 From: Ray Jones Date: Tue, 7 Jan 2020 12:30:13 +1100 Subject: [PATCH] BUG FIX: insufficient wait time after OEM controller data packet, bad calc of start time :-( --- src/Protocol/TxManage.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Protocol/TxManage.cpp b/src/Protocol/TxManage.cpp index 6c7dd89..2a0078c 100644 --- a/src/Protocol/TxManage.cpp +++ b/src/Protocol/TxManage.cpp @@ -252,7 +252,7 @@ CTxManage::PrepareFrame(const CProtocol& basisFrame, bool isBTCmaster) void CTxManage::Start(unsigned long timenow) { - m_nStartTime = timenow + m_nStartTime; // create a dwell period if an OEM controller is present after it's data exchange + m_nStartTime = timenow + m_nStartDelay; // create a dwell period if an OEM controller is present after it's data exchange m_nStartTime |= 1; // avoid a black hole if millis() has wrapped to zero m_bTxPending = true; } @@ -267,7 +267,8 @@ CTxManage::CheckTx(unsigned long timenow) long diff = timenow - m_nStartTime; - if(diff >= 0) { // dwell since OEM exchange has expired ? + // dwell since OEM exchange has expired ? + if(diff >= 0) { // begin front porch of Tx gating pulse digitalWrite(m_nTxGatePin, HIGH); }