From ccfab65fb1e3dcbea3b35d377fa74f3a58d84edd Mon Sep 17 00:00:00 2001 From: Oliver Kleinecke Date: Mon, 3 Feb 2025 23:41:54 +0100 Subject: [PATCH] Update mcp4461.cpp --- esphome/components/mcp4461/mcp4461.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/esphome/components/mcp4461/mcp4461.cpp b/esphome/components/mcp4461/mcp4461.cpp index 02b95b51a7..1da46abb5d 100644 --- a/esphome/components/mcp4461/mcp4461.cpp +++ b/esphome/components/mcp4461/mcp4461.cpp @@ -121,7 +121,7 @@ uint8_t Mcp4461Component::get_wiper_address_(uint8_t wiper) { return addr; } -uint16_t Mcp4461Component::get_wiper_level(MCP4461WiperIdx wiper) { +uint16_t Mcp4461Component::get_wiper_level(Mcp4461WiperIdx wiper) { uint8_t wiper_idx = static_cast(wiper); return this->read_wiper_level_(wiper_idx); } @@ -145,7 +145,7 @@ uint16_t Mcp4461Component::read_wiper_level_(uint8_t wiper) { return buf; } -void Mcp4461Component::update_wiper_level(MCP4461WiperIdx wiper) { +void Mcp4461Component::update_wiper_level(Mcp4461WiperIdx wiper) { uint8_t wiper_idx = static_cast(wiper); uint16_t data; data = this->get_wiper_level(wiper); @@ -153,7 +153,7 @@ void Mcp4461Component::update_wiper_level(MCP4461WiperIdx wiper) { this->reg_[wiper_idx].state = data; } -void Mcp4461Component::set_wiper_level(MCP4461WiperIdx wiper, uint16_t value) { +void Mcp4461Component::set_wiper_level(Mcp4461WiperIdx wiper, uint16_t value) { uint8_t wiper_idx = static_cast(wiper); if (data > 0x100) { ESP_LOGW(TAG, "ignoring invalid wiper level %" PRIu16 "!"); @@ -173,21 +173,21 @@ void Mcp4461Component::write_wiper_level_(uint8_t wiper, uint16_t value) { this->mcp4461_write_(this->get_wiper_address_(wiper_idx), value, nonvolatile); } -void Mcp4461Component::enable_wiper(MCP4461WiperIdx wiper) { +void Mcp4461Component::enable_wiper(Mcp4461WiperIdx wiper) { uint8_t wiper_idx = static_cast(wiper); ESP_LOGV(TAG, "Enabling wiper %" PRIu8, wiper_idx); this->reg_[wiper_idx].terminal_hw = true; this->update_ = true; } -void Mcp4461Component::disable_wiper(MCP4461WiperIdx wiper) { +void Mcp4461Component::disable_wiper(Mcp4461WiperIdx wiper) { uint8_t wiper_idx = static_cast(wiper); ESP_LOGV(TAG, "Disabling wiper %" PRIu8, wiper_idx); this->reg_[wiper_idx].terminal_hw = false; this->update_ = true; } -void Mcp4461Component::increase_wiper(MCP4461WiperIdx wiper) { +void Mcp4461Component::increase_wiper(Mcp4461WiperIdx wiper) { uint8_t wiper_idx = static_cast(wiper); ESP_LOGV(TAG, "Increasing wiper %" PRIu8 "", wiper_idx); uint8_t reg = 0; @@ -199,7 +199,7 @@ void Mcp4461Component::increase_wiper(MCP4461WiperIdx wiper) { this->reg_[wiper_idx].state++; } -void Mcp4461Component::decrease_wiper(MCP4461WiperIdx wiper) { +void Mcp4461Component::decrease_wiper(Mcp4461WiperIdx wiper) { uint8_t wiper_idx = static_cast(wiper); ESP_LOGV(TAG, "Decreasing wiper %" PRIu8 "", wiper_idx); uint8_t reg = 0; @@ -291,7 +291,7 @@ void Mcp4461Component::set_terminal_register(Mcp4461TerminalIdx terminal_connect this->mcp4461_write_(addr, data); } -void Mcp4461Component::enable_terminal(MCP4461WiperIdx wiper, char terminal) { +void Mcp4461Component::enable_terminal(Mcp4461WiperIdx wiper, char terminal) { uint8_t wiper_idx = static_cast(wiper); if (wiper_idx > 3) { return; @@ -318,7 +318,7 @@ void Mcp4461Component::enable_terminal(MCP4461WiperIdx wiper, char terminal) { this->update_ = true; } -void Mcp4461Component::disable_terminal(MCP4461WiperIdx wiper, char terminal) { +void Mcp4461Component::disable_terminal(Mcp4461WiperIdx wiper, char terminal) { uint8_t wiper_idx = static_cast(wiper); if (wiper_idx > 3) { return;