mirror of
https://github.com/lumapu/ahoy.git
synced 2025-07-09 04:27:17 +02:00
improved changes from PR #1234
This commit is contained in:
parent
67e8f69ce3
commit
b57e463b92
3 changed files with 7 additions and 9 deletions
|
@ -13,7 +13,7 @@
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 8
|
#define VERSION_MINOR 8
|
||||||
#define VERSION_PATCH 8
|
#define VERSION_PATCH 9
|
||||||
|
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -44,8 +44,8 @@ class Communication : public CommQueue<> {
|
||||||
if(!valid)
|
if(!valid)
|
||||||
return; // empty
|
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 = 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_min = q->iv->ivGen != IV_MI ? ((q->iv->mGotFragment) ? SINGLEFR_TIMEOUT : FRSTMSG_TIMEOUT) : MI_TIMEOUT;
|
||||||
bool testMode = false;
|
bool testMode = false;
|
||||||
|
|
||||||
switch(mState) {
|
switch(mState) {
|
||||||
|
|
|
@ -309,10 +309,8 @@ class HmRadio : public Radio {
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool checkIvSerial(uint8_t buf[], Inverter<> *iv) {
|
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++) {
|
for(uint8_t i = 0; i < 4; i++) {
|
||||||
if(tmp[i] != buf[i])
|
if(buf[3-i] != iv->radioId.b[i])
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue