Skip to content

Commit

Permalink
0.7.63
Browse files Browse the repository at this point in the history
* fix NRF24 communication #1200
  • Loading branch information
lumapu committed Oct 1, 2023
1 parent 169eea7 commit ebb79d1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Development Changes

## 0.7.63 - 2023-10-01
* fix NRF24 communication #1200

## 0.7.62 - 2023-10-01
* fix communication to inverters #1198
* add timeout before payload is tried to process (necessary for HMS/HMT)
Expand Down
4 changes: 2 additions & 2 deletions src/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ void app::loop(void) {
mPayload.add(iv, p);
}
mNrfRadio.mBufCtrl.pop();
processPayload = true;
yield();
}
processPayload = true;
mMiPayload.process(true);
}
#if defined(ESP32)
Expand All @@ -168,9 +168,9 @@ void app::loop(void) {
mPayload.add(iv, p);
}
mCmtRadio.mBufCtrl.pop();
processPayload = true;
yield();
}
processPayload = true;
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 7
#define VERSION_PATCH 62
#define VERSION_PATCH 63

//-------------------------------------
typedef struct {
Expand Down
2 changes: 1 addition & 1 deletion src/hm/hmPayload.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class HmPayload {
}

if((IV_HMS == iv->ivGen) || (IV_HMT == iv->ivGen)) {
if((mPayload[iv->id].sendMillis + 500) > millis())
if((mPayload[iv->id].sendMillis + 400) > millis())
return; // to fast, wait until packets are received!
}

Expand Down
6 changes: 4 additions & 2 deletions src/hm/hmRadio.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class HmRadio : public Radio {
pinMode(irq, INPUT_PULLUP);

generateDtuSn();
DTU_RADIO_ID = ((uint64_t)(((mDtuSn >> 24) & 0xFF) | ((mDtuSn >> 8) & 0xFF00) | ((mDtuSn << 8) & 0xFF0000) | ((mDtuSn << 24) & 0xFF000000)) << 8) | 0x01;

#ifdef ESP32
#if CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
Expand All @@ -81,7 +82,7 @@ class HmRadio : public Radio {
mNrf24.enableDynamicPayloads();
mNrf24.setCRCLength(RF24_CRC_16);
mNrf24.setAddressWidth(5);
mNrf24.openReadingPipe(1, reinterpret_cast<uint8_t*>(&mDtuSn));
mNrf24.openReadingPipe(1, reinterpret_cast<uint8_t*>(&DTU_RADIO_ID));

// enable all receiving interrupts
mNrf24.maskIRQ(false, false, false);
Expand Down Expand Up @@ -202,7 +203,7 @@ class HmRadio : public Radio {
std::queue<packet_t> mBufCtrl;

private:
bool getReceived(void) {
inline bool getReceived(void) {
bool tx_ok, tx_fail, rx_ready;
mNrf24.whatHappened(tx_ok, tx_fail, rx_ready); // resets the IRQ pin to HIGH

Expand Down Expand Up @@ -262,6 +263,7 @@ class HmRadio : public Radio {
return iv->radioId.u64;
}

uint64_t DTU_RADIO_ID;
uint8_t mRfChLst[RF_CHANNELS];
uint8_t mTxChIdx;
uint8_t mRxChIdx;
Expand Down

0 comments on commit ebb79d1

Please sign in to comment.