Update ToshibaDaiseikaiHeatpumpIR.cpp

checksum calculation fix
This commit is contained in:
nelgi 2019-11-17 20:56:41 +02:00 committed by GitHub
parent 141276f1e7
commit 4a1220f12f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 39 deletions

View File

@ -97,45 +97,7 @@ void ToshibaDaiseikaiHeatpumpIR::sendDaiseikai(IRSender& IR, uint8_t operatingMo
// Checksum
for (int i=0; i<8; i++) {
checksum += IR.bitReverse(sendBuffer[i]);
}
// There's something really strange with the checksum calculation...
// With these many of the codes matchs with the code from the real Carrier remote
// Still certain temperatures do not work with fan speeds 1, 2 or 5
switch (sendBuffer[6] & 0xF0) {
case 0x00: // MODE_AUTO - certain temperature / fan speed combinations do not work
checksum += 0x02;
switch (sendBuffer[6] & 0x0F) {
case 0x02: // FAN1
case 0x03: // FAN5
case 0x06: // FAN2
checksum += 0x80;
break;
}
break;
case 0x40: // MODE_DRY - all settings should work
checksum += 0x02;
break;
case 0xC0: // MODE_HEAT - certain temperature / fan speed combinations do not work
switch (sendBuffer[6] & 0x0F) {
case 0x05: // FAN4
case 0x06: // FAN2
checksum += 0xC0;
break;
}
break;
case 0x20: // MODE_FAN - all settings should work
checksum += 0x02;
switch (sendBuffer[6] & 0x0F) {
case 0x02: // FAN1
case 0x03: // FAN5
case 0x06: // FAN2
checksum += 0x80;
break;
}
break;
checksum ^= IR.bitReverse(sendBuffer[i]);
}
sendBuffer[8] = IR.bitReverse(checksum);