mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2025-06-27 20:59:37 +00:00
refactor
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user