[mcp9600] Fix setup success check using OR instead of AND (#15165)

This commit is contained in:
Jonathan Swoboda
2026-03-25 14:06:48 -04:00
committed by GitHub
parent 65d0a91fcc
commit c42c6745b9
+14 -14
View File
@@ -40,20 +40,20 @@ void MCP9600Component::setup() {
} }
bool success = this->write_byte(MCP9600_REGISTER_STATUS, 0x00); bool success = this->write_byte(MCP9600_REGISTER_STATUS, 0x00);
success |= this->write_byte(MCP9600_REGISTER_SENSOR_CONFIG, uint8_t(0x00 | thermocouple_type_ << 4)); success &= this->write_byte(MCP9600_REGISTER_SENSOR_CONFIG, uint8_t(0x00 | thermocouple_type_ << 4));
success |= this->write_byte(MCP9600_REGISTER_CONFIG, 0x00); success &= this->write_byte(MCP9600_REGISTER_CONFIG, 0x00);
success |= this->write_byte(MCP9600_REGISTER_ALERT1_CONFIG, 0x00); success &= this->write_byte(MCP9600_REGISTER_ALERT1_CONFIG, 0x00);
success |= this->write_byte(MCP9600_REGISTER_ALERT2_CONFIG, 0x00); success &= this->write_byte(MCP9600_REGISTER_ALERT2_CONFIG, 0x00);
success |= this->write_byte(MCP9600_REGISTER_ALERT3_CONFIG, 0x00); success &= this->write_byte(MCP9600_REGISTER_ALERT3_CONFIG, 0x00);
success |= this->write_byte(MCP9600_REGISTER_ALERT4_CONFIG, 0x00); success &= this->write_byte(MCP9600_REGISTER_ALERT4_CONFIG, 0x00);
success |= this->write_byte(MCP9600_REGISTER_ALERT1_HYSTERESIS, 0x00); success &= this->write_byte(MCP9600_REGISTER_ALERT1_HYSTERESIS, 0x00);
success |= this->write_byte(MCP9600_REGISTER_ALERT2_HYSTERESIS, 0x00); success &= this->write_byte(MCP9600_REGISTER_ALERT2_HYSTERESIS, 0x00);
success |= this->write_byte(MCP9600_REGISTER_ALERT3_HYSTERESIS, 0x00); success &= this->write_byte(MCP9600_REGISTER_ALERT3_HYSTERESIS, 0x00);
success |= this->write_byte(MCP9600_REGISTER_ALERT4_HYSTERESIS, 0x00); success &= this->write_byte(MCP9600_REGISTER_ALERT4_HYSTERESIS, 0x00);
success |= this->write_byte_16(MCP9600_REGISTER_ALERT1_LIMIT, 0x0000); success &= this->write_byte_16(MCP9600_REGISTER_ALERT1_LIMIT, 0x0000);
success |= this->write_byte_16(MCP9600_REGISTER_ALERT2_LIMIT, 0x0000); success &= this->write_byte_16(MCP9600_REGISTER_ALERT2_LIMIT, 0x0000);
success |= this->write_byte_16(MCP9600_REGISTER_ALERT3_LIMIT, 0x0000); success &= this->write_byte_16(MCP9600_REGISTER_ALERT3_LIMIT, 0x0000);
success |= this->write_byte_16(MCP9600_REGISTER_ALERT4_LIMIT, 0x0000); success &= this->write_byte_16(MCP9600_REGISTER_ALERT4_LIMIT, 0x0000);
if (!success) { if (!success) {
this->error_code_ = FAILED_TO_UPDATE_CONFIGURATION; this->error_code_ = FAILED_TO_UPDATE_CONFIGURATION;