diff --git a/src/CHANGES.md b/src/CHANGES.md index 418acb84..74401b87 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -1,5 +1,10 @@ # Development Changes +## 0.8.20 - 2023-12-12 +* improved HM communication #1259 #1249 +* fix `loadDefaults` for ethernet builds #1263 +* don't loop through radios which aren't in use #1264 + ## 0.8.19 - 2023-12-11 * added ms to serial log * added (debug) option to configure gap between inverter requests diff --git a/src/config/settings.h b/src/config/settings.h index a2851bd0..92ad1195 100644 --- a/src/config/settings.h +++ b/src/config/settings.h @@ -67,16 +67,13 @@ typedef struct { bool darkMode; bool schedReboot; -#if defined(ETHERNET) - // ethernet - -#else /* defined(ETHERNET) */ +#if !defined(ETHERNET) // wifi char stationSsid[SSID_LEN]; char stationPwd[PWD_LEN]; char apPwd[PWD_LEN]; bool isHidden; -#endif /* defined(ETHERNET) */ +#endif /* !defined(ETHERNET) */ cfgIp_t ip; } cfgSys_t; diff --git a/src/defines.h b/src/defines.h index 24bcc8a5..79555749 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 19 +#define VERSION_PATCH 20 //------------------------------------- typedef struct { diff --git a/src/hm/Communication.h b/src/hm/Communication.h index e8c17d1e..23934c0c 100644 --- a/src/hm/Communication.h +++ b/src/hm/Communication.h @@ -51,6 +51,11 @@ class Communication : public CommQueue<> { uint16_t timeout = (q->iv->ivGen == IV_MI) ? MI_TIMEOUT : ((q->iv->mGotFragment && q->iv->mGotLastMsg) || mIsResend) ? SINGLEFR_TIMEOUT : DEFAULT_TIMEOUT; uint16_t timeout_min = (q->iv->ivGen == IV_MI) ? MI_TIMEOUT : ((q->iv->mGotFragment || mIsResend)) ? SINGLEFR_TIMEOUT : FRSTMSG_TIMEOUT; + /*if(mDebugState != mState) { + DPRINT(DBG_INFO, F("State: ")); + DBGHEXLN((uint8_t)(mState)); + mDebugState = mState; + }*/ switch(mState) { case States::RESET: if(millis() < mWaitTimeout) @@ -99,7 +104,7 @@ class Communication : public CommQueue<> { break; case States::WAIT: - if(millis() > mWaitTimeout_min) { + /*if(millis() > mWaitTimeout_min) { if(mIsResend) { // we already have been through... mWaitTimeout = mWaitTimeout_min; } else if(q->iv->mGotFragment) { // nothing received yet? @@ -120,7 +125,7 @@ class Communication : public CommQueue<> { break; } - } + }*/ if(millis() < mWaitTimeout) return; mState = States::CHECK_FRAMES; @@ -200,7 +205,7 @@ class Communication : public CommQueue<> { q->iv->radio->mBufCtrl.pop(); yield(); } - if((0 == q->attempts) && (!q->iv->mGotFragment)) + if(0 == q->attempts) closeRequest(q, false, true); else { if(q->iv->ivGen != IV_MI) @@ -459,7 +464,7 @@ class Communication : public CommQueue<> { mWaitTimeout = millis() + SINGLEFR_TIMEOUT; // timeout mState = States::WAIT; } else { - add(q, true); + //add(q, true); closeRequest(q, false, true); } } @@ -476,7 +481,7 @@ class Communication : public CommQueue<> { } mWaitTimeout = millis() + *mInverterGap; - cmdDone(delCmd); + cmdDone(q->delOnPop); q->iv->mGotFragment = false; q->iv->mGotLastMsg = false; q->iv->miMultiParts = 0; @@ -839,6 +844,8 @@ class Communication : public CommQueue<> { payloadListenerType mCbPayload = NULL; alarmListenerType mCbAlarm = NULL; Heuristic mHeu; + + //States mDebugState = States::START; }; #endif /*__COMMUNICATION_H__*/