mirror of
https://github.com/esphome/esphome.git
synced 2025-04-14 23:00:29 +01:00
Update mcp4461.cpp
This commit is contained in:
parent
d2ba3eef3a
commit
ae6f128951
@ -263,11 +263,11 @@ void Mcp4461Component::update_wiper_level(Mcp4461WiperIdx wiper) {
|
|||||||
ESP_LOGE(TAG, "%s", LOG_STR_ARG(mcp4461_get_message_string_(this->error_code_)));
|
ESP_LOGE(TAG, "%s", LOG_STR_ARG(mcp4461_get_message_string_(this->error_code_)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
uint8_t wiper_idx = static_cast<uint8_t>(wiper);
|
||||||
if (!(this->reg_[wiper_idx].enabled)) {
|
if (!(this->reg_[wiper_idx].enabled)) {
|
||||||
ESP_LOGW(TAG, "%s", LOG_STR_ARG(mcp4461_get_message_string_(MCP4461_WIPER_DISABLED)));
|
ESP_LOGW(TAG, "%s", LOG_STR_ARG(mcp4461_get_message_string_(MCP4461_WIPER_DISABLED)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uint8_t wiper_idx = static_cast<uint8_t>(wiper);
|
|
||||||
uint16_t data;
|
uint16_t data;
|
||||||
data = this->get_wiper_level(wiper);
|
data = this->get_wiper_level(wiper);
|
||||||
ESP_LOGV(TAG, "Got value %" PRIu16 " from wiper %" PRIu8, data, wiper_idx);
|
ESP_LOGV(TAG, "Got value %" PRIu16 " from wiper %" PRIu8, data, wiper_idx);
|
||||||
@ -315,6 +315,7 @@ void Mcp4461Component::enable_wiper(Mcp4461WiperIdx wiper) {
|
|||||||
ESP_LOGE(TAG, "%s", LOG_STR_ARG(mcp4461_get_message_string_(this->error_code_)));
|
ESP_LOGE(TAG, "%s", LOG_STR_ARG(mcp4461_get_message_string_(this->error_code_)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
uint8_t wiper_idx = static_cast<uint8_t>(wiper);
|
||||||
if ((this->reg_[wiper_idx].enabled)) {
|
if ((this->reg_[wiper_idx].enabled)) {
|
||||||
ESP_LOGW(TAG, "%s", LOG_STR_ARG(mcp4461_get_message_string_(MCP4461_WIPER_ENABLED)));
|
ESP_LOGW(TAG, "%s", LOG_STR_ARG(mcp4461_get_message_string_(MCP4461_WIPER_ENABLED)));
|
||||||
return;
|
return;
|
||||||
@ -323,7 +324,6 @@ void Mcp4461Component::enable_wiper(Mcp4461WiperIdx wiper) {
|
|||||||
ESP_LOGW(TAG, "%s", LOG_STR_ARG(mcp4461_get_message_string_(MCP4461_WIPER_LOCKED)));
|
ESP_LOGW(TAG, "%s", LOG_STR_ARG(mcp4461_get_message_string_(MCP4461_WIPER_LOCKED)));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uint8_t wiper_idx = static_cast<uint8_t>(wiper);
|
|
||||||
ESP_LOGV(TAG, "Enabling wiper %" PRIu8, wiper_idx);
|
ESP_LOGV(TAG, "Enabling wiper %" PRIu8, wiper_idx);
|
||||||
this->reg_[wiper_idx].terminal_hw = true;
|
this->reg_[wiper_idx].terminal_hw = true;
|
||||||
this->update_ = true;
|
this->update_ = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user