Browse Source

bug fix esp8266

pull/1197/head
lumapu 1 year ago
parent
commit
124cbf6ba2
  1. 11
      src/app.cpp
  2. 4
      src/hm/hmInverter.h

11
src/app.cpp

@ -64,8 +64,10 @@ void app::setup() {
mSys.addInverter(i, [this](Inverter<> *iv) {
if((IV_MI == iv->ivGen) || (IV_HM == iv->ivGen))
iv->radio = &mNrfRadio;
#if defined(ESP32)
else if((IV_HMS == iv->ivGen) || (IV_HMT == iv->ivGen))
iv->radio = &mCmtRadio;
#endif
});
}
if (mConfig->nrf.enabled) {
@ -116,6 +118,7 @@ void app::setup() {
//-----------------------------------------------------------------------------
void app::loop(void) {
ah::Scheduler::loop();
bool processPayload = false;
if (mNrfRadio.loop() && mConfig->nrf.enabled) {
while (!mNrfRadio.mBufCtrl.empty()) {
@ -142,7 +145,7 @@ void app::loop(void) {
mNrfRadio.mBufCtrl.pop();
yield();
}
mPayload.process(true);
processPayload = true;
mMiPayload.process(true);
}
#if defined(ESP32)
@ -167,9 +170,13 @@ void app::loop(void) {
mCmtRadio.mBufCtrl.pop();
yield();
}
mPayload.process(false); //true
processPayload = true;
}
#endif
if(processPayload)
mPayload.process(true);
mPayload.loop();
mMiPayload.loop();

4
src/hm/hmInverter.h

@ -169,7 +169,6 @@ class Inverter {
mDevControlRequest = false;
devControlCmd = InitDataState;
initialized = false;
//lastAlarmMsg = "nothing";
alarmMesIndex = 0;
isConnected = false;
status = InverterStatus::OFF;
@ -364,9 +363,6 @@ class Inverter {
}
else if (rec->assign == AlarmDataAssignment) {
DPRINTLN(DBG_DEBUG, "add alarm");
//if (getPosByChFld(0, FLD_LAST_ALARM_CODE, rec) == pos){
// lastAlarmMsg = getAlarmStr(rec->record[pos]);
//}
}
else
DPRINTLN(DBG_WARN, F("add with unknown assignment"));

Loading…
Cancel
Save