Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Jan 30, 2025
1 parent ae0cf34 commit bf38361
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions components/tc_bus/tc_bus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,16 +325,17 @@ namespace esphome

// Store bit for potential ACK command
if (curBit == 0 || curBit == 1) {
if (ackBits < 5) {
if (ackBits < 4) { // Changed from 5 to 4 since we want 4 data bits
if (curBit) {
ackCommand |= (1 << (4 - ackBits)); // Store data bits
ackCommand |= (1 << ackBits); // Changed bit shifting to use ackBits directly
}
ackCalCRC ^= curBit;
ackBits++;
} else if (ackBits == 5) {
ESP_LOGD(TAG, "ACK bit %d: %d, command now: %02X", ackBits, curBit, ackCommand);
} else if (ackBits == 4) { // Changed from 5 to 4
ackCRC = curBit; // Store CRC bit
ackBits++;
ESP_LOGD(TAG, "ACK command before validation: %02X", ackCommand); // Debug log
ESP_LOGD(TAG, "ACK command before validation: %02X, CRC: %d", ackCommand, ackCRC);
}
}

Expand Down

0 comments on commit bf38361

Please sign in to comment.