From 8b07f544caab4d607ac6d0768132cf40c41fed62 Mon Sep 17 00:00:00 2001 From: DashyFox Date: Fri, 16 Feb 2024 17:23:16 +0300 Subject: [PATCH] fix end of data detect --- IR_Decoder.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/IR_Decoder.cpp b/IR_Decoder.cpp index 3a59f33..f9257e6 100644 --- a/IR_Decoder.cpp +++ b/IR_Decoder.cpp @@ -1,7 +1,7 @@ #include "IR_Decoder.h" #include "IR_Encoder.h" -// #define IRDEBUG_INFO +#define IRDEBUG_INFO #define checkAddr(h, l) (\ ((uint16_t)((dataBuffer[h] << 8) | dataBuffer[l]) == addrSelf) || \ @@ -403,7 +403,7 @@ void IR_Decoder::writeToBuffer(bool bit) { void IR_Decoder::packToOutClass(uint8_t endBitOffset, uint8_t bytesToCheck, uint8_t addressForCheckOffset, InputData* objFine, InputData* objWrong = nullptr) { uint16_t crcValue; InputData* objResult = nullptr; - if (i_dataBuffer >= endBitOffset) { + if (i_dataBuffer == endBitOffset) { #ifdef IRDEBUG_INFO Serial.print(" IN "); #endif @@ -424,7 +424,6 @@ void IR_Decoder::packToOutClass(uint8_t endBitOffset, uint8_t bytesToCheck, uint objResult->_set(dataBuffer, bytesToCheck + crcBytes, crcValue, errors, riseSyncTime); } isRecive = false; - start_RX(); } }