diff --git a/src/defines.h b/src/defines.h index 4d95b022..72f2887f 100644 --- a/src/defines.h +++ b/src/defines.h @@ -13,7 +13,7 @@ //------------------------------------- #define VERSION_MAJOR 0 #define VERSION_MINOR 8 -#define VERSION_PATCH 8 +#define VERSION_PATCH 9 //------------------------------------- typedef struct { diff --git a/src/hm/Communication.h b/src/hm/Communication.h index ce2a7175..c599cadc 100644 --- a/src/hm/Communication.h +++ b/src/hm/Communication.h @@ -44,8 +44,8 @@ class Communication : public CommQueue<> { if(!valid) return; // empty - uint16_t timeout = q->iv->ivGen != IV_MI ? (q->iv->mGotFragment && q->iv->mGotLastMsg) ? SINGLEFR_TIMEOUT : DEFAULT_TIMEOUT : MI_TIMEOUT; - uint16_t timeout_min = q->iv->ivGen != IV_MI ? q->iv->mGotFragment ? SINGLEFR_TIMEOUT : FRSTMSG_TIMEOUT : MI_TIMEOUT; + uint16_t timeout = q->iv->ivGen != IV_MI ? ((q->iv->mGotFragment && q->iv->mGotLastMsg) ? SINGLEFR_TIMEOUT : DEFAULT_TIMEOUT) : MI_TIMEOUT; + uint16_t timeout_min = q->iv->ivGen != IV_MI ? ((q->iv->mGotFragment) ? SINGLEFR_TIMEOUT : FRSTMSG_TIMEOUT) : MI_TIMEOUT; bool testMode = false; switch(mState) { @@ -63,7 +63,7 @@ class Communication : public CommQueue<> { testMode = mHeu.getTestModeEnabled(); q->iv->mGotFragment = false; q->iv->mGotLastMsg = false; - mFirstTry = mFirstTry ? false : ( ( (IV_HM == q->iv->ivGen) || (IV_MI == q->iv->ivGen) ) && (q->iv->isAvailable()) || (millis() < 120000) ); + mFirstTry = mFirstTry ? false : (((IV_HM == q->iv->ivGen) || (IV_MI == q->iv->ivGen) ) && (q->iv->isAvailable()) || (millis() < 120000)); if(NULL == q->iv->radio) cmdDone(true); // can't communicate while radio is not defined! mState = States::START; @@ -97,8 +97,8 @@ class Communication : public CommQueue<> { if(millis() > mWaitTimeout_min) { if(!q->iv->mGotFragment) { // nothing received yet? if(q->iv->mGotLastMsg) { - //mState = States::CHECK_FRAMES; - mWaitTimeout = mWaitTimeout_min; + //mState = States::CHECK_FRAMES; + mWaitTimeout = mWaitTimeout_min; } } else if(mFirstTry) { DPRINT_IVID(DBG_INFO, q->iv->id); diff --git a/src/hm/hmRadio.h b/src/hm/hmRadio.h index d0a7b250..88e62f8f 100644 --- a/src/hm/hmRadio.h +++ b/src/hm/hmRadio.h @@ -309,10 +309,8 @@ class HmRadio : public Radio { } inline bool checkIvSerial(uint8_t buf[], Inverter<> *iv) { - uint8_t tmp[4]; - CP_U32_BigEndian(tmp, iv->radioId.u64 >> 8); for(uint8_t i = 0; i < 4; i++) { - if(tmp[i] != buf[i]) + if(buf[3-i] != iv->radioId.b[i]) return false; } return true;