From f762d2c315de2bea829ea4346d8d302e0ba6d126 Mon Sep 17 00:00:00 2001 From: Oliver Kleinecke Date: Sat, 8 Feb 2025 15:50:36 +0100 Subject: [PATCH] Update mcp4461.cpp --- esphome/components/mcp4461/mcp4461.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esphome/components/mcp4461/mcp4461.cpp b/esphome/components/mcp4461/mcp4461.cpp index 6b0774a664..3682f58c66 100644 --- a/esphome/components/mcp4461/mcp4461.cpp +++ b/esphome/components/mcp4461/mcp4461.cpp @@ -212,7 +212,7 @@ uint16_t Mcp4461Component::read_wiper_level_(uint8_t wiper) { reg |= this->get_wiper_address_(wiper); reg |= static_cast(Mcp4461Commands::READ); if (wiper > 3) { - if (this->is_eeprom_busy_()) { + if (this->is_eeprom_ready_for_writing_(true)) { return 0; } } @@ -511,7 +511,7 @@ uint16_t Mcp4461Component::get_eeprom_value(Mcp4461EepromLocation location) { reg |= static_cast(Mcp4461EepromLocation::MCP4461_EEPROM_1) + (static_cast(location) * 0x10); reg |= static_cast(Mcp4461Commands::READ); uint16_t buf; - if (this->is_eeprom_busy_()) { + if (this->is_eeprom_ready_for_writing_(true)) { return 0; } if (!this->read_byte_16(reg, &buf)) { @@ -642,7 +642,7 @@ bool Mcp4461Component::mcp4461_write_(uint8_t addr, uint16_t data, bool nonvolat ESP_LOGW(TAG, "Ignoring write to write protected chip"); return false; } - if (this->is_eeprom_busy_()) { + if (this->is_eeprom_ready_for_writing_(true)) { return false; } this->previous_write_exec_time_ = millis();