diff --git a/src/EasyOpenTherm.cpp b/src/EasyOpenTherm.cpp index f586103..e8df629 100644 --- a/src/EasyOpenTherm.cpp +++ b/src/EasyOpenTherm.cpp @@ -376,8 +376,7 @@ bool OTPhysicalLayer::send(uint32_t fr return false; } -// if(_state == STATE::READY && millis() - _lastReceivedTimestampMs < 100) { - if(_state == STATE::READY && millis() - _lastReceivedTimestampMicros < 100) { + if(_state == STATE::READY && millis() - _lastReceivedTimestampMs < 100) { return false; // Wait at least 100 ms after receiving the final bit of the latest frame before sending a new frame } @@ -485,8 +484,7 @@ void OTPhysicalLayer::handleInterrupt() { lastTimestamp = timestamp; mask >>= 1; } else { // stop bit -// _lastReceivedTimestampMs = millis(); - _lastReceivedTimestampMicros = micros(); + _lastReceivedTimestampMs = millis(); _state = STATE::READY; } } diff --git a/src/EasyOpenTherm.h b/src/EasyOpenTherm.h index 4100575..935240a 100644 --- a/src/EasyOpenTherm.h +++ b/src/EasyOpenTherm.h @@ -527,8 +527,7 @@ private: volatile uint32_t _frame; uint32_t _lastSentTimestampMs; -// volatile uint32_t _lastReceivedTimestampMs; - volatile uint32_t _lastReceivedTimestampMicros; + volatile uint32_t _lastReceivedTimestampMs; uint8_t _rxPin; uint8_t _txPin;