This commit is contained in:
2024-02-22 16:52:55 +03:00
parent 6f5bbac83c
commit e35bf7ae23
7 changed files with 124 additions and 46 deletions

View File

@ -349,14 +349,21 @@ void IR_DecoderRaw::writeToBuffer(bool bit) {
if (!isAvailable && isData) {
if (i_dataBuffer == 8 * msgBytes) {// Ппервый байт
packSize = (dataBuffer[0] & IR_MASK_MSG_INFO) + crcBytes;
packSize = dataBuffer[0] & IR_MASK_MSG_INFO;
Serial.print(" ["); Serial.print(packSize); Serial.print("] ");
}
if (packSize && (i_dataBuffer == packSize*bitPerByte)) { // Конец
isAvailable = crcCheck(packSize - crcBytes, crcValue);
Serial.print(" END DATA ");
packInfo.buffer = dataBuffer;
packInfo.crc = crcValue;
packInfo.err = errors;
packInfo.packSize = packSize;
packInfo.rTime = riseSyncTime;
isRecive = false;
isAvailable = crcCheck(packSize - crcBytes, crcValue);
}
}