fix end of data detect

This commit is contained in:
DashyFox 2024-02-16 17:23:16 +03:00
parent 59a01e6803
commit 8b07f544ca

View File

@ -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();
}
}