From 97d74d309000e8e210178ee829c51a1ad6a4545f Mon Sep 17 00:00:00 2001 From: lumapu Date: Thu, 25 Jan 2024 00:03:49 +0100 Subject: [PATCH] 0.8.65 - 2024-01-24 * removed patch for NRF `PLOS` * fix lang issues #1388 * fix build on Windows of `opendtufusion` environments (git: trailing whitespaces) --- patches/RF24.patch | 35 ----------------------------------- scripts/applyPatches.py | 6 ++---- src/CHANGES.md | 5 +++++ src/defines.h | 2 +- src/hm/CommQueue.h | 6 ++---- src/hm/Communication.h | 14 +------------- src/hm/hmRadio.h | 27 ++++++--------------------- src/hm/radio.h | 10 ++++------ src/hms/hmsRadio.h | 11 +++++------ src/web/lang.json | 4 ++-- 10 files changed, 28 insertions(+), 92 deletions(-) delete mode 100644 patches/RF24.patch diff --git a/patches/RF24.patch b/patches/RF24.patch deleted file mode 100644 index 63db88236..000000000 --- a/patches/RF24.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/RF24.cpp b/RF24.cpp -index 9e5b4a8..a4de63c 100644 ---- a/RF24.cpp -+++ b/RF24.cpp -@@ -1871,6 +1871,11 @@ uint8_t RF24::getARC(void) - return read_register(OBSERVE_TX) & 0x0F; - } - -+uint8_t RF24::getPLOS(void) -+{ -+ return read_register(OBSERVE_TX) & 0x0F; -+} -+ - /****************************************************************************/ - - bool RF24::setDataRate(rf24_datarate_e speed) -diff --git a/RF24.h b/RF24.h -index dbd32ae..a3d6b52 100644 ---- a/RF24.h -+++ b/RF24.h -@@ -1644,6 +1644,7 @@ public: - * @return Returns values from 0 to 15. - */ - uint8_t getARC(void); -+ uint8_t getPLOS(void); - - /** - * Set the transmission @ref Datarate -@@ -2415,4 +2416,4 @@ private: - * Use `ctrl+c` to quit at any time. - */ - --#endif // __RF24_H__ -\ No newline at end of file -+#endif // __RF24_H__ diff --git a/scripts/applyPatches.py b/scripts/applyPatches.py index 3289badbf..147fb0f3a 100644 --- a/scripts/applyPatches.py +++ b/scripts/applyPatches.py @@ -12,11 +12,11 @@ def applyPatch(libName, patchFile): os.chdir('.pio/libdeps/' + env['PIOENV'] + '/' + libName) - process = subprocess.run(['git', 'apply', '--reverse', '--check', '../../../../' + patchFile], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + process = subprocess.run(['git', 'apply', '--ignore-whitespace', '--reverse', '--check', '../../../../' + patchFile], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) if (process.returncode == 0): print('\'' + patchFile + '\' already applied') else: - process = subprocess.run(['git', 'apply', '../../../../' + patchFile]) + process = subprocess.run(['git', 'apply', '--ignore-whitespace', '../../../../' + patchFile]) if (process.returncode == 0): print('\'' + patchFile + '\' applied') else: @@ -32,5 +32,3 @@ def applyPatch(libName, patchFile): if env['PIOENV'][:13] == "opendtufusion": applyPatch("GxEPD2", "../patches/GxEPD2_SW_SPI.patch") applyPatch("RF24", "../patches/RF24_Hal.patch") -else: - applyPatch("RF24", "../patches/RF24.patch") diff --git a/src/CHANGES.md b/src/CHANGES.md index a4942d55e..b8547302f 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -1,5 +1,10 @@ # Development Changes +## 0.8.65 - 2024-01-24 +* removed patch for NRF `PLOS` +* fix lang issues #1388 +* fix build on Windows of `opendtufusion` environments (git: trailing whitespaces) + ## 0.8.64 - 2024-01-22 * add `ARC` to log (NRF24 Debug) * merge PR: ETH NTP update bugfix #1385 diff --git a/src/defines.h b/src/defines.h index b8ddace93..ed975b7a1 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 64 +#define VERSION_PATCH 65 //------------------------------------- typedef struct { diff --git a/src/hm/CommQueue.h b/src/hm/CommQueue.h index d3fe1c693..0ca9279fa 100644 --- a/src/hm/CommQueue.h +++ b/src/hm/CommQueue.h @@ -18,8 +18,6 @@ template class CommQueue { public: - CommQueue() {} - void addImportant(Inverter<> *iv, uint8_t cmd) { dec(&mRdPtr); mQueue[mRdPtr] = queue_s(iv, cmd, true); @@ -34,12 +32,12 @@ class CommQueue { mQueue[mWrPtr] = queue_s(iv, cmd, false); } - uint8_t getFillState(void) { + uint8_t getFillState(void) const { //DPRINTLN(DBG_INFO, "wr: " + String(mWrPtr) + ", rd: " + String(mRdPtr)); return abs(mRdPtr - mWrPtr); } - uint8_t getMaxFill(void) { + uint8_t getMaxFill(void) const { return N; } diff --git a/src/hm/Communication.h b/src/hm/Communication.h index 98dd06e15..3a6fdd0b1 100644 --- a/src/hm/Communication.h +++ b/src/hm/Communication.h @@ -134,14 +134,7 @@ class Communication : public CommQueue<> { DPRINT_IVID(DBG_INFO, q->iv->id); DBGPRINT(F("request timeout: ")); DBGPRINT(String(q->iv->radio->mRadioWaitTime.getRunTime())); - DBGPRINT(F("ms")); - if(INV_RADIO_TYPE_NRF == q->iv->ivRadioType) { - DBGPRINT(F(", ARC ")); - DBGPRINT(String(q->iv->radio->getARC())); - DBGPRINT(F(", PLOS ")); - DBGPRINTLN(String(q->iv->radio->getPLOS())); - } else - DBGPRINTLN(""); + DBGPRINTLN(F("ms")); } if(!q->iv->mGotFragment) { if(INV_RADIO_TYPE_CMT == q->iv->ivRadioType) { @@ -291,11 +284,6 @@ class Communication : public CommQueue<> { DBGPRINT(String(p->millis)); DBGPRINT(F("ms | ")); DBGPRINT(String(p->len)); - DBGPRINT(F(", ARC ")); - DBGPRINT(String(p->arc)); - DBGPRINT(F(", PLOS ")); - DBGPRINT(String(p->plos)); - DBGPRINT(F(" |")); if(INV_RADIO_TYPE_NRF == q->iv->ivRadioType) { DBGPRINT(F(" CH")); if(3 == p->ch) diff --git a/src/hm/hmRadio.h b/src/hm/hmRadio.h index ef37e266e..d73b2b0e4 100644 --- a/src/hm/hmRadio.h +++ b/src/hm/hmRadio.h @@ -15,7 +15,6 @@ #endif #define SPI_SPEED 1000000 - #define RF_CHANNELS 5 const char* const rf24AmpPowerNames[] = {"MIN", "LOW", "HIGH", "MAX"}; @@ -183,17 +182,13 @@ class HmRadio : public Radio { } } return mNRFisInRX; - } /*else if(tx_fail) { - mNRFisInRX = false; - return false; - }*/ + } } return false; } - bool isChipConnected(void) { - //DPRINTLN(DBG_VERBOSE, F("hmRadio.h:isChipConnected")); + bool isChipConnected(void) const { return mNrf24->isChipConnected(); } @@ -283,24 +278,16 @@ class HmRadio : public Radio { sendPacket(iv, cnt, isRetransmit, (IV_MI != iv->ivGen)); } - uint8_t getDataRate(void) { + uint8_t getDataRate(void) const { if(!mNrf24->isChipConnected()) return 3; // unknown return mNrf24->getDataRate(); } - bool isPVariant(void) { + bool isPVariant(void) const { return mNrf24->isPVariant(); } - uint8_t getARC(void) { - return mNrf24->getARC(); - } - - uint8_t getPLOS(void) { - return mNrf24->getPLOS(); - } - private: inline bool getReceived(void) { bool isLastPackage = false; @@ -315,8 +302,6 @@ class HmRadio : public Radio { p.len = (len > MAX_RF_PAYLOAD_SIZE) ? MAX_RF_PAYLOAD_SIZE : len; p.rssi = mNrf24->testRPD() ? -64 : -75; p.millis = millis() - mMillis; - p.arc = mNrf24->getARC(); - p.plos = mNrf24->getPLOS(); mNrf24->read(p.packet, p.len); if (p.packet[0] != 0x00) { @@ -393,11 +378,11 @@ class HmRadio : public Radio { mNRFisInRX = false; } - uint64_t getIvId(Inverter<> *iv) { + uint64_t getIvId(Inverter<> *iv) const { return iv->radioId.u64; } - uint8_t getIvGen(Inverter<> *iv) { + uint8_t getIvGen(Inverter<> *iv) const { return iv->ivGen; } diff --git a/src/hm/radio.h b/src/hm/radio.h index a71e24c7a..f7d61e42b 100644 --- a/src/hm/radio.h +++ b/src/hm/radio.h @@ -27,10 +27,8 @@ class Radio { virtual void sendControlPacket(Inverter<> *iv, uint8_t cmd, uint16_t *data, bool isRetransmit) = 0; virtual bool switchFrequency(Inverter<> *iv, uint32_t fromkHz, uint32_t tokHz) { return true; } virtual bool switchFrequencyCh(Inverter<> *iv, uint8_t fromCh, uint8_t toCh) { return true; } - virtual bool isChipConnected(void) { return false; } + virtual bool isChipConnected(void) const { return false; } virtual bool loop(void) = 0; - virtual uint8_t getARC(void) { return 0xff; } - virtual uint8_t getPLOS(void) { return 0xff; } void handleIntr(void) { mIrqRcvd = true; @@ -66,7 +64,7 @@ class Radio { sendPacket(iv, 24, isRetransmit); } - uint32_t getDTUSn(void) { + uint32_t getDTUSn(void) const { return mDtuSn; } @@ -81,8 +79,8 @@ class Radio { protected: virtual void sendPacket(Inverter<> *iv, uint8_t len, bool isRetransmit, bool appendCrc16=true) = 0; - virtual uint64_t getIvId(Inverter<> *iv) = 0; - virtual uint8_t getIvGen(Inverter<> *iv) = 0; + virtual uint64_t getIvId(Inverter<> *iv) const = 0; + virtual uint8_t getIvGen(Inverter<> *iv) const = 0; void initPacket(uint64_t ivId, uint8_t mid, uint8_t pid) { mTxBuf[0] = mid; diff --git a/src/hms/hmsRadio.h b/src/hms/hmsRadio.h index 48ff3750e..2f0a5f310 100644 --- a/src/hms/hmsRadio.h +++ b/src/hms/hmsRadio.h @@ -14,8 +14,7 @@ class CmtRadio : public Radio { typedef Cmt2300a CmtType; public: CmtRadio() { - mDtuSn = DTU_SN; - mCmtAvail = false; + mDtuSn = DTU_SN; } void setup(bool *serialDebug, bool *privacyMode, bool *printWholeTrace, uint8_t pinSclk, uint8_t pinSdio, uint8_t pinCsb, uint8_t pinFcsb, bool genDtuSn = true) { @@ -38,7 +37,7 @@ class CmtRadio : public Radio { return false; } - bool isChipConnected(void) { + bool isChipConnected(void) const { return mCmtAvail; } @@ -116,11 +115,11 @@ class CmtRadio : public Radio { iv->mDtuTxCnt++; } - uint64_t getIvId(Inverter<> *iv) { + uint64_t getIvId(Inverter<> *iv) const { return iv->radioId.u64; } - uint8_t getIvGen(Inverter<> *iv) { + uint8_t getIvGen(Inverter<> *iv) const { return iv->ivGen; } @@ -172,7 +171,7 @@ class CmtRadio : public Radio { } CmtType mCmt; - bool mCmtAvail; + bool mCmtAvail = false; bool mRqstGetRx = false; uint32_t mMillis; }; diff --git a/src/web/lang.json b/src/web/lang.json index 1eece9372..9f3df46ec 100644 --- a/src/web/lang.json +++ b/src/web/lang.json @@ -670,7 +670,7 @@ }, { "token": "INV_DELETE_SURE", - "en": "do you realy want to delete inverter?", + "en": "do you really want to delete inverter?", "de": "Willst du den Wechselrichter wirklich löschen?" }, { @@ -1070,7 +1070,7 @@ }, { "token": "WARN_DIFF_ENV", - "en": "your environment does not match the update file!", + "en": "your environment may not match the update file!", "de": "Die ausgewählte Firmware passt u.U. nicht zum Chipsatz!" }, {