Browse Source

fix inverter restrictions

(choose the correct channels and the correct amount...)
pull/1284/head
rejoe2 2 years ago
committed by GitHub
parent
commit
3f77b5e26d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/defines.h
  2. 5
      src/hm/Communication.h
  3. 8
      src/hm/hmRadio.h

2
src/defines.h

@ -13,7 +13,7 @@
//------------------------------------- //-------------------------------------
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 8 #define VERSION_MINOR 8
#define VERSION_PATCH 2301 #define VERSION_PATCH 2304
//------------------------------------- //-------------------------------------
typedef struct { typedef struct {

5
src/hm/Communication.h

@ -202,6 +202,7 @@ class Communication : public CommQueue<> {
if(q->iv->miMultiParts < 6) { if(q->iv->miMultiParts < 6) {
mState = States::WAIT; mState = States::WAIT;
} else { } else {
mHeu.evalTxChQuality(q->iv, true, (4 - q->attempts), q->iv->curFrmCnt);
if(((q->cmd == 0x39) && (q->iv->type == INV_TYPE_4CH)) 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_CH2) && (q->iv->type == INV_TYPE_2CH))
|| ((q->cmd == MI_REQ_CH1) && (q->iv->type == INV_TYPE_1CH))) { || ((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]); miStsConsolidate(q, datachan, rec, p->packet[23], p->packet[24]);
if (p->packet[0] < (0x39 + ALL_FRAMES) ) { if (p->packet[0] < (0x39 + ALL_FRAMES) ) {
mHeu.evalTxChQuality(q->iv, true, (4 - q->attempts), 1);
miNextRequest((p->packet[0] - ALL_FRAMES + 1), q); miNextRequest((p->packet[0] - ALL_FRAMES + 1), q);
} else { } else {
q->iv->miMultiParts = 7; // indicate we are ready 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)) { } else if((p->packet[0] == (MI_REQ_CH1 + ALL_FRAMES)) && (q->iv->type == INV_TYPE_2CH)) {
//addImportant(q->iv, MI_REQ_CH2); //addImportant(q->iv, MI_REQ_CH2);
miNextRequest(MI_REQ_CH2, q); miNextRequest(MI_REQ_CH2, q);
//use also miMultiParts here for better statistics? //use also miMultiParts here for better statistics?
//mHeu.setGotFragment(q->iv); //mHeu.setGotFragment(q->iv);
mHeu.evalTxChQuality(q->iv, true, (4 - q->attempts), q->iv->curFrmCnt);
} else { // first data msg for 1ch, 2nd for 2ch } else { // first data msg for 1ch, 2nd for 2ch
q->iv->miMultiParts += 6; // indicate we are ready q->iv->miMultiParts += 6; // indicate we are ready
//miComplete(q->iv);
} }
} }

8
src/hm/hmRadio.h

@ -108,6 +108,7 @@ class HmRadio : public Radio {
if (singleframe) { if (singleframe) {
iv->mRxTmoOuterLoop = 65; // SINGLEFR_TIMEOUT iv->mRxTmoOuterLoop = 65; // SINGLEFR_TIMEOUT
iv->lastCmd = 0xFF; iv->lastCmd = 0xFF;
//DPRINTLN(DBG_INFO, F("1 frm"));
return; return;
} }
@ -121,20 +122,24 @@ class HmRadio : public Radio {
iv->mRxChannels = 3; iv->mRxChannels = 3;
iv->mRxTmoOuterLoop = 300; iv->mRxTmoOuterLoop = 300;
iv->mRxTmoInnerLoop = 5110; iv->mRxTmoInnerLoop = 5110;
//DPRINTLN(DBG_INFO, F("4ch data"));
} else { } else {
iv->mRxChannels = 2; iv->mRxChannels = 2;
iv->mRxTmoOuterLoop = 250; iv->mRxTmoOuterLoop = 250;
iv->mRxTmoInnerLoop = 10220; iv->mRxTmoInnerLoop = 10220;
//DPRINTLN(DBG_INFO, F("1/2ch data"));
} }
} else { //3rd gen defaults } else { //3rd gen defaults
iv->mRxChannels = 3; iv->mRxChannels = 3;
iv->mRxTmoOuterLoop = 500; iv->mRxTmoOuterLoop = 500;
iv->mRxTmoInnerLoop = 5110; iv->mRxTmoInnerLoop = 5110;
//DPRINTLN(DBG_INFO, F("3rd gen default"));
} }
} else { // 2nd gen defaults } else { // 2nd gen defaults
iv->mRxChannels = 2; iv->mRxChannels = 2;
iv->mRxTmoOuterLoop = 250; iv->mRxTmoOuterLoop = 250;
iv->mRxTmoInnerLoop = 5110; iv->mRxTmoInnerLoop = 5110;
//DPRINTLN(DBG_INFO, F("2nd gen default"));
} }
} }
@ -171,10 +176,11 @@ class HmRadio : public Radio {
/*if(++mRxChIdx >= RF_CHANNELS) /*if(++mRxChIdx >= RF_CHANNELS)
mRxChIdx = 0;*/ mRxChIdx = 0;*/
//if(++mRxChIdx >= mLastIv->mRxChannels)
if(++mRxChIdx >= mLastIv->mRxChannels) if(++mRxChIdx >= mLastIv->mRxChannels)
mRxChIdx = 0; 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[mRxChIdx]);
mNrf24->setChannel(mRfChLst[nextRxCh]); mNrf24->setChannel(mRfChLst[nextRxCh]);

Loading…
Cancel
Save