1
0
mirror of https://github.com/esphome/esphome.git synced 2025-04-02 17:08:17 +01:00

Update mcp4461.cpp

This commit is contained in:
Oliver Kleinecke 2025-02-04 10:14:09 +01:00 committed by GitHub
parent c86a0c8489
commit db1bcc2ffe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -345,7 +345,7 @@ void Mcp4461Component::disable_terminal(Mcp4461WiperIdx wiper, char terminal) {
uint16_t Mcp4461Component::get_eeprom_value(Mcp4461EepromLocation location) {
uint8_t reg = 0;
reg |= static_cast<uint8_t>(Mcp4461EepromLocation::MCP4461_EEPROM_1 + (static_cast<uint8_t>(location) * 0x10));
reg |= static_cast<uint8_t>(Mcp4461EepromLocation::MCP4461_EEPROM_1) + (static_cast<uint8_t>(location) * 0x10);
reg |= static_cast<uint8_t>(Mcp4461Commands::READ);
uint16_t buf;
if (!this->read_byte_16(reg, &buf)) {
@ -364,7 +364,7 @@ void Mcp4461Component::set_eeprom_value(Mcp4461EepromLocation location, uint16_t
if (value > 256) {
addr = 1;
}
addr |= static_cast<uint8_t>(Mcp4461EepromLocation::MCP4461_EEPROM_1 + (static_cast<uint8_t>(location) * 0x10));
addr |= static_cast<uint8_t>(Mcp4461EepromLocation::MCP4461_EEPROM_1) + (static_cast<uint8_t>(location) * 0x10);
this->mcp4461_write_(addr, value, true);
}