From f779062993a1fadb7e7136229f1cc0402818e0a0 Mon Sep 17 00:00:00 2001 From: rejoe2 Date: Wed, 20 Dec 2023 17:58:34 +0100 Subject: [PATCH] small changes in timing for alarmdata --- src/defines.h | 2 +- src/hm/CommQueue.h | 6 +++++- src/hm/Communication.h | 13 +++++++++++-- src/hm/hmRadio.h | 2 ++ src/hms/hmsRadio.h | 4 ++++ 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/defines.h b/src/defines.h index 045f671c..cffc0278 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 2706 +#define VERSION_PATCH 2708 //------------------------------------- typedef struct { diff --git a/src/hm/CommQueue.h b/src/hm/CommQueue.h index dc688bc3..ed594189 100644 --- a/src/hm/CommQueue.h +++ b/src/hm/CommQueue.h @@ -78,11 +78,15 @@ class CommQueue { cb(true, &mQueue[mRdPtr]); } - void cmdDone(bool keep = false) { + void cmdDone(bool keep = false, bool fastNext = false) { if(keep) { mQueue[mRdPtr].attempts = 5; add(mQueue[mRdPtr]); // add to the end again + } /*else if(fastNext) { + mQueue[mRdPtr].attempts = 5; + mQueue[mRdPtr].cmd = RealTimeRunData_Debug; } + if(!fastNext)*/ inc(&mRdPtr); } diff --git a/src/hm/Communication.h b/src/hm/Communication.h index a4aa70fa..48e92ce9 100644 --- a/src/hm/Communication.h +++ b/src/hm/Communication.h @@ -59,7 +59,8 @@ class Communication : public CommQueue<> { mLastEmptyQueueMillis = millis(); mPrintSequenceDuration = true; - uint16_t timeout = (q->iv->ivGen == IV_MI) ? MI_TIMEOUT : ((q->iv->mGotFragment && q->iv->mGotLastMsg) || mIsRetransmit) ? SINGLEFR_TIMEOUT : DEFAULT_TIMEOUT; + uint16_t timeout = (q->iv->ivGen == IV_MI) ? MI_TIMEOUT : ((q->iv->mGotFragment && q->iv->mGotLastMsg) || mIsRetransmit) ? SINGLEFR_TIMEOUT : + q->cmd != AlarmData ? DEFAULT_TIMEOUT : 1.5 * DEFAULT_TIMEOUT; uint16_t timeout_min = (q->iv->ivGen == IV_MI) ? MI_TIMEOUT : ((q->iv->mGotFragment || mIsRetransmit)) ? SINGLEFR_TIMEOUT : FRSTMSG_TIMEOUT; /*if(mDebugState != mState) { @@ -548,7 +549,15 @@ class Communication : public CommQueue<> { if(q->isDevControl) keep = !crcPass; - cmdDone(keep); + bool fastNext = false; + if(crcPass && q->iv->ivGen != IV_MI && q->cmd != RealTimeRunData_Debug) + fastNext = true; + + cmdDone(keep, fastNext); + /*if (fastNext) + add(q->iv, RealTimeRunData_Debug); + */ + q->iv->mGotFragment = false; q->iv->mGotLastMsg = false; q->iv->miMultiParts = 0; diff --git a/src/hm/hmRadio.h b/src/hm/hmRadio.h index a4c226fb..a18fa5ec 100644 --- a/src/hm/hmRadio.h +++ b/src/hm/hmRadio.h @@ -365,6 +365,8 @@ class HmRadio : public Radio { } else DBGPRINT(F("0x")); DHEX(mTxBuf[0]); + DBGPRINT(F(" 0x")); + DHEX(mTxBuf[10]); DBGPRINT(F(" ")); DBGHEXLN(mTxBuf[9]); } diff --git a/src/hms/hmsRadio.h b/src/hms/hmsRadio.h index 40200085..d57a590b 100644 --- a/src/hms/hmsRadio.h +++ b/src/hms/hmsRadio.h @@ -96,6 +96,10 @@ class CmtRadio : public Radio { else ah::dumpBuf(mTxBuf, len); } else + DBGPRINT(F("0x")); + DHEX(mTxBuf[0]); + DBGPRINT(F(" 0x")); + DHEX(mTxBuf[10]); DBGHEXLN(mTxBuf[9]); }