pendular version

let rx channel change between tx+2 and tx+3
This commit is contained in:
rejoe2 2024-01-25 08:22:03 +01:00 committed by GitHub
parent d7ea4bcb89
commit d8af398208
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 14 deletions

View file

@ -124,7 +124,7 @@ class HmRadio : public Radio {
rxPendular = !rxPendular;
//innerLoopTimeout = (rxPendular ? 1 : 2)*DURATION_LISTEN_MIN;
innerLoopTimeout = DURATION_LISTEN_MIN;
//innerLoopTimeout = DURATION_LISTEN_MIN;
if(mNRFloopChannels)
tempRxChIdx = (tempRxChIdx + 4) % RF_CHANNELS;
@ -154,7 +154,8 @@ class HmRadio : public Radio {
if(tx_ok)
mLastIv->mAckCount++;
mRxChIdx = (mTxChIdx + 2) % RF_CHANNELS;
//mRxChIdx = (mTxChIdx + 2) % RF_CHANNELS;
mRxChIdx = (mTxChIdx + 3) % RF_CHANNELS;
mNrf24->setChannel(mRfChLst[mRxChIdx]);
mNrf24->startListening();
mTimeslotStart = millis();
@ -162,7 +163,8 @@ class HmRadio : public Radio {
rxPendular = false;
mNRFloopChannels = (mLastIv->ivGen == IV_MI);
innerLoopTimeout = mLastIv->ivGen != IV_MI ? DURATION_TXFRAME : DURATION_ONEFRAME;
//innerLoopTimeout = mLastIv->ivGen != IV_MI ? DURATION_TXFRAME : DURATION_ONEFRAME;
innerLoopTimeout = DURATION_LISTEN_MIN;
}
if(rx_ready) {
@ -186,10 +188,7 @@ class HmRadio : public Radio {
}
rx_ready = false; // reset
return mNRFisInRX;
} /*else if(tx_fail) {
mNRFisInRX = false;
return false;
}*/
}
}
return false;