From c71377011bb2a56c2589b00b2987bef6a98a0854 Mon Sep 17 00:00:00 2001 From: lumapu Date: Sun, 10 Dec 2023 11:14:36 +0100 Subject: [PATCH] 0.8.17 * possible fix of NRF with opendtufusion (without ETH) * small fix in heuristics (if conditions made assignment not comparisson) --- src/CHANGES.md | 4 ++++ src/defines.h | 2 +- src/hm/Heuristic.h | 2 +- src/hm/hmRadio.h | 12 +++--------- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/CHANGES.md b/src/CHANGES.md index 6cba5040..e7fbefcc 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -1,5 +1,9 @@ # Development Changes +## 0.8.17 - 2023-12-10 +* possible fix of NRF with opendtufusion (without ETH) +* small fix in heuristics (if conditions made assignment not comparisson) + ## 0.8.16 - 2023-12-09 * fix crash if NRF is not enabled * updated heuristic #1080 #1259 diff --git a/src/defines.h b/src/defines.h index 9d35b9be..351810fa 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 16 +#define VERSION_PATCH 17 //------------------------------------- typedef struct { diff --git a/src/hm/Heuristic.h b/src/hm/Heuristic.h index c0101e62..6b28f216 100644 --- a/src/hm/Heuristic.h +++ b/src/hm/Heuristic.h @@ -41,7 +41,7 @@ class Heuristic { if(ih->testPeriodFailCnt > RF_TEST_PERIOD_MAX_FAIL_CNT) { // try round robbin another chan and see if it works even better ih->testChId = (ih->testChId + 1) % RF_MAX_CHANNEL_ID; - if(ih->testChId = ih->txRfChId) + if(ih->testChId == ih->txRfChId) ih->testChId = (ih->testChId + 1) % RF_MAX_CHANNEL_ID; // give it a fair chance but remember old status in case of immediate fail diff --git a/src/hm/hmRadio.h b/src/hm/hmRadio.h index 618f8e9a..4c0bff73 100644 --- a/src/hm/hmRadio.h +++ b/src/hm/hmRadio.h @@ -46,11 +46,6 @@ class HmRadio : public Radio { void setup(bool *serialDebug, bool *privacyMode, bool *printWholeTrace, uint8_t irq = IRQ_PIN, uint8_t ce = CE_PIN, uint8_t cs = CS_PIN, uint8_t sclk = SCLK_PIN, uint8_t mosi = MOSI_PIN, uint8_t miso = MISO_PIN) { DPRINTLN(DBG_VERBOSE, F("hmRadio.h:setup")); - #if defined(CONFIG_IDF_TARGET_ESP32S3) && defined(ETHERNET) - // replace object - mNrfHal.init(mosi, miso, sclk, cs, ce); - mNrf24.reset(new RF24(&mNrfHal)); - #endif pinMode(irq, INPUT_PULLUP); mSerialDebug = serialDebug; @@ -72,7 +67,8 @@ class HmRadio : public Radio { #ifdef ESP32 #if defined(CONFIG_IDF_TARGET_ESP32S3) && defined(ETHERNET) - // + mNrfHal.init(mosi, miso, sclk, cs, ce); + mNrf24.reset(new RF24(&mNrfHal)); #else #if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 mSpi.reset(new SPIClass(HSPI)); @@ -87,7 +83,7 @@ class HmRadio : public Radio { mSpi->begin(); #endif - #if defined(CONFIG_IDF_TARGET_ESP32S3) + #if defined(CONFIG_IDF_TARGET_ESP32S3) && defined(ETHERNET) mNrf24->begin(); #else mNrf24->begin(mSpi.get(), ce, cs); @@ -127,8 +123,6 @@ class HmRadio : public Radio { mNrf24->flush_tx(); // empty TX FIFO // start listening - //mNrf24->setChannel(23); - //mRxChIdx = 0; mNrf24->setChannel(mRfChLst[mRxChIdx]); mNrf24->startListening();