Skip to content

Commit

Permalink
0.8.65 - 2024-01-24
Browse files Browse the repository at this point in the history
* removed patch for NRF `PLOS`
* fix lang issues #1388
* fix build on Windows of `opendtufusion` environments (git: trailing whitespaces)
  • Loading branch information
lumapu committed Jan 24, 2024
1 parent 7f386f0 commit 97d74d3
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 92 deletions.
35 changes: 0 additions & 35 deletions patches/RF24.patch

This file was deleted.

6 changes: 2 additions & 4 deletions scripts/applyPatches.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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")
5 changes: 5 additions & 0 deletions src/CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
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 8
#define VERSION_PATCH 64
#define VERSION_PATCH 65

//-------------------------------------
typedef struct {
Expand Down
6 changes: 2 additions & 4 deletions src/hm/CommQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
template <uint8_t N=100>
class CommQueue {
public:
CommQueue() {}

void addImportant(Inverter<> *iv, uint8_t cmd) {
dec(&mRdPtr);
mQueue[mRdPtr] = queue_s(iv, cmd, true);
Expand All @@ -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;
}

Expand Down
14 changes: 1 addition & 13 deletions src/hm/Communication.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
Expand Down
27 changes: 6 additions & 21 deletions src/hm/hmRadio.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#endif

#define SPI_SPEED 1000000

#define RF_CHANNELS 5

const char* const rf24AmpPowerNames[] = {"MIN", "LOW", "HIGH", "MAX"};
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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;
Expand All @@ -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) {
Expand Down Expand Up @@ -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;
}

Expand Down
10 changes: 4 additions & 6 deletions src/hm/radio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -66,7 +64,7 @@ class Radio {
sendPacket(iv, 24, isRetransmit);
}

uint32_t getDTUSn(void) {
uint32_t getDTUSn(void) const {
return mDtuSn;
}

Expand All @@ -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;
Expand Down
11 changes: 5 additions & 6 deletions src/hms/hmsRadio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -38,7 +37,7 @@ class CmtRadio : public Radio {
return false;
}

bool isChipConnected(void) {
bool isChipConnected(void) const {
return mCmtAvail;
}

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -172,7 +171,7 @@ class CmtRadio : public Radio {
}

CmtType mCmt;
bool mCmtAvail;
bool mCmtAvail = false;
bool mRqstGetRx = false;
uint32_t mMillis;
};
Expand Down
4 changes: 2 additions & 2 deletions src/web/lang.json
Original file line number Diff line number Diff line change
Expand Up @@ -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&ouml;schen?"
},
{
Expand Down Expand Up @@ -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&auml;hlte Firmware passt u.U. nicht zum Chipsatz!"
},
{
Expand Down

0 comments on commit 97d74d3

Please sign in to comment.