mirror of
https://github.com/Show-maket/IR-protocol.git
synced 2025-06-27 20:59:37 +00:00
fix syncBit
This commit is contained in:
@ -24,6 +24,13 @@ IR_Encoder::~IR_Encoder() {
|
||||
delete [] sendBuffer;
|
||||
};
|
||||
|
||||
void IR_Encoder::sendData(uint16_t addrTo, uint8_t* data, uint8_t len, bool needAccept = false) {
|
||||
uint8_t packSize = msgBytes + addrBytes + addrBytes + len + crcBytes;
|
||||
uint8_t msgType =
|
||||
((needAccept ? IR_MSG_DATA_ACCEPT : IR_MSG_DATA_NOACCEPT) << 5) | ((packSize - crcBytes) & IR_MASK_MSG_INFO);
|
||||
_sendData(addrTo, data, len, msgType);
|
||||
}
|
||||
|
||||
void IR_Encoder::sendACK(uint16_t addrTo, uint8_t addInfo, bool forAll = false) {
|
||||
uint8_t* ptr = new uint8_t[msgBytes + addrBytes + crcBytes] { 0 };
|
||||
|
||||
@ -184,7 +191,7 @@ void IR_Encoder::isr() {
|
||||
toggleCounter = currentBitSequence[!state];
|
||||
dataSequenceCounter--;
|
||||
} else { // Конец data, переход на следующий signal
|
||||
syncLastBit = !((sendBuffer[dataByteCounter]) & 1U);
|
||||
syncLastBit = ((sendBuffer[dataByteCounter]) & 1U);
|
||||
dataByteCounter++;
|
||||
dataBitCounter = bitPerByte - 1;
|
||||
dataSequenceCounter = bitPerByte * 2;
|
||||
|
Reference in New Issue
Block a user