discord .2901

- add longer timeout + more retransmits to GridProfile req.
- close GridProfile + GetLossRate req. explicitly (also for heuristiscs)
This commit is contained in:
rejoe2 2023-12-28 12:03:00 +01:00 committed by GitHub
parent b942b37cfd
commit e8185b9e80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 4 deletions

View file

@ -121,9 +121,10 @@ class HmRadio : public Radio {
uint32_t startMicros = micros();
uint32_t loopMillis = millis();
uint32_t outerLoopTimeout = (mLastIv->mIsSingleframeReq) ? 100 : ((mLastIv->mCmd != AlarmData) ? 400 : 600);
uint32_t outerLoopTimeout = (mLastIv->mIsSingleframeReq) ? 100 : ((mLastIv->mCmd != AlarmData) && (mLastIv->mCmd != GridOnProFilePara)) ? 400 : 600;
while ((millis() - loopMillis) < outerLoopTimeout) {
uint32_t startMicros = micros();
while ((micros() - startMicros) < 5110) { // listen (4088us or?) 5110us to each channel
if (mIrqRcvd) {
mIrqRcvd = false;
@ -137,7 +138,6 @@ class HmRadio : public Radio {
// switch to next RX channel
mRxChIdx = (mRxChIdx + 1) % RF_CHANNELS;
mNrf24->setChannel(mRfChLst[mRxChIdx]);
startMicros = micros();
}
// not finished but time is over
mRxChIdx = (mRxChIdx + 1) % RF_CHANNELS;