From 03ae7eb0fb7fd695e0ab35c50128305ee48a72b7 Mon Sep 17 00:00:00 2001 From: Oliver Kleinecke Date: Sun, 9 Feb 2025 12:24:30 +0100 Subject: [PATCH 1/2] Update mcp4461.cpp --- esphome/components/mcp4461/mcp4461.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/mcp4461/mcp4461.cpp b/esphome/components/mcp4461/mcp4461.cpp index 0dded2b625..6c0d1ae1ba 100644 --- a/esphome/components/mcp4461/mcp4461.cpp +++ b/esphome/components/mcp4461/mcp4461.cpp @@ -669,13 +669,13 @@ bool Mcp4461Component::is_eeprom_ready_for_writing_(bool wait_if_not_ready) { /* Timestamp before starting the loop */ const uint32_t start_millis = millis(); - + ESP_LOGV(TAG, "Waiting until EEPROM is ready for write, start_millis = %" PRIu32, start_millis); /* Loop until EEPROM is ready or timeout is reached */ while (!ready_for_write && ((millis() - start_millis) < EEPROM_WRITE_TIMEOUT_MS)) { ready_for_write = !this->is_writing_(); - + /* If ready, exit early */ if (ready_for_write) { ESP_LOGV(TAG, "EEPROM is ready for new write, elapsed_millis = %" PRIu32, millis() - start_millis); From b1b30849c7e0f33134a176a202bee24eb331dd5d Mon Sep 17 00:00:00 2001 From: Oliver Kleinecke Date: Sun, 9 Feb 2025 12:26:10 +0100 Subject: [PATCH 2/2] Update mcp4461.h --- esphome/components/mcp4461/mcp4461.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esphome/components/mcp4461/mcp4461.h b/esphome/components/mcp4461/mcp4461.h index e9ac6b66ee..272b1366a8 100644 --- a/esphome/components/mcp4461/mcp4461.h +++ b/esphome/components/mcp4461/mcp4461.h @@ -98,10 +98,10 @@ class Mcp4461Component : public Component, public i2c::I2CDevice { MCP4461_STATUS_REGISTER_ERROR, // Error fetching status register MCP4461_PARENT_FAILED, // Parent component failed MCP4461_VALUE_INVALID, // Invalid value given for wiper / eeprom - MCP4461_WRITE_PROTECTED, // The value was read, but the CRC over the payload (valid and data) does not match - MCP4461_WIPER_ENABLED, // The wiper is enabled, discard additional enabling actions - MCP4461_WIPER_DISABLED, // The wiper is disabled - all actions for this wiper will be aborted/discarded - MCP4461_WIPER_LOCKED, // The wiper is locked using WiperLock-technology - all actions for this wiper will be aborted/discarded + MCP4461_WRITE_PROTECTED, // The value was read, but the CRC over the payload (valid and data) does not match + MCP4461_WIPER_ENABLED, // The wiper is enabled, discard additional enabling actions + MCP4461_WIPER_DISABLED, // The wiper is disabled - all actions for this wiper will be aborted/discarded + MCP4461_WIPER_LOCKED, // The wiper is locked using WiperLock-technology - all actions for this wiper will be aborted/discarded } error_code_{MCP4461_STATUS_OK}; protected: