From 3f77b5e26dfb5954fc26f06cc1e7bc9c4848eb23 Mon Sep 17 00:00:00 2001 From: rejoe2 Date: Fri, 15 Dec 2023 12:43:49 +0100 Subject: [PATCH] fix inverter restrictions (choose the correct channels and the correct amount...) --- src/defines.h | 2 +- src/hm/Communication.h | 5 +++-- src/hm/hmRadio.h | 8 +++++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/defines.h b/src/defines.h index 8939a8f8..cf552aa0 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 2301 +#define VERSION_PATCH 2304 //------------------------------------- typedef struct { diff --git a/src/hm/Communication.h b/src/hm/Communication.h index 43b57426..07ded1bf 100644 --- a/src/hm/Communication.h +++ b/src/hm/Communication.h @@ -202,6 +202,7 @@ class Communication : public CommQueue<> { if(q->iv->miMultiParts < 6) { mState = States::WAIT; } else { + mHeu.evalTxChQuality(q->iv, true, (4 - q->attempts), q->iv->curFrmCnt); if(((q->cmd == 0x39) && (q->iv->type == INV_TYPE_4CH)) || ((q->cmd == MI_REQ_CH2) && (q->iv->type == INV_TYPE_2CH)) || ((q->cmd == MI_REQ_CH1) && (q->iv->type == INV_TYPE_1CH))) { @@ -686,19 +687,19 @@ class Communication : public CommQueue<> { miStsConsolidate(q, datachan, rec, p->packet[23], p->packet[24]); if (p->packet[0] < (0x39 + ALL_FRAMES) ) { + mHeu.evalTxChQuality(q->iv, true, (4 - q->attempts), 1); miNextRequest((p->packet[0] - ALL_FRAMES + 1), q); } else { q->iv->miMultiParts = 7; // indicate we are ready - //miComplete(q->iv); } } else if((p->packet[0] == (MI_REQ_CH1 + ALL_FRAMES)) && (q->iv->type == INV_TYPE_2CH)) { //addImportant(q->iv, MI_REQ_CH2); miNextRequest(MI_REQ_CH2, q); //use also miMultiParts here for better statistics? //mHeu.setGotFragment(q->iv); + mHeu.evalTxChQuality(q->iv, true, (4 - q->attempts), q->iv->curFrmCnt); } else { // first data msg for 1ch, 2nd for 2ch q->iv->miMultiParts += 6; // indicate we are ready - //miComplete(q->iv); } } diff --git a/src/hm/hmRadio.h b/src/hm/hmRadio.h index a2094d86..abf68048 100644 --- a/src/hm/hmRadio.h +++ b/src/hm/hmRadio.h @@ -108,6 +108,7 @@ class HmRadio : public Radio { if (singleframe) { iv->mRxTmoOuterLoop = 65; // SINGLEFR_TIMEOUT iv->lastCmd = 0xFF; + //DPRINTLN(DBG_INFO, F("1 frm")); return; } @@ -121,20 +122,24 @@ class HmRadio : public Radio { iv->mRxChannels = 3; iv->mRxTmoOuterLoop = 300; iv->mRxTmoInnerLoop = 5110; + //DPRINTLN(DBG_INFO, F("4ch data")); } else { iv->mRxChannels = 2; iv->mRxTmoOuterLoop = 250; iv->mRxTmoInnerLoop = 10220; + //DPRINTLN(DBG_INFO, F("1/2ch data")); } } else { //3rd gen defaults iv->mRxChannels = 3; iv->mRxTmoOuterLoop = 500; iv->mRxTmoInnerLoop = 5110; + //DPRINTLN(DBG_INFO, F("3rd gen default")); } } else { // 2nd gen defaults iv->mRxChannels = 2; iv->mRxTmoOuterLoop = 250; iv->mRxTmoInnerLoop = 5110; + //DPRINTLN(DBG_INFO, F("2nd gen default")); } } @@ -171,10 +176,11 @@ class HmRadio : public Radio { /*if(++mRxChIdx >= RF_CHANNELS) mRxChIdx = 0;*/ + //if(++mRxChIdx >= mLastIv->mRxChannels) if(++mRxChIdx >= mLastIv->mRxChannels) mRxChIdx = 0; - uint8_t nextRxCh = (mRxChIdx + mTxChIdx + 1) % RF_MAX_CHANNEL_ID; + uint8_t nextRxCh = (mRxChIdx + mTxChIdx + 4) % RF_MAX_CHANNEL_ID; // let 3 channels in shifting out; might cause problems for tx channel 75, see Oberfritze remark to his array //mNrf24->setChannel(mRfChLst[mRxChIdx]); mNrf24->setChannel(mRfChLst[nextRxCh]);