mirror of
https://github.com/esphome/esphome.git
synced 2025-09-25 14:42:21 +01:00
Update mcp4461.cpp
This commit is contained in:
@@ -366,6 +366,10 @@ bool Mcp4461Component::increase_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 false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (this->reg_[wiper_idx].state == 256) {
|
||||||
|
ESP_LOGV(TAG, "%s", "Maximum wiper level reached, further increase of wiper %" PRIu8 " prohibited", wiper_idx);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
ESP_LOGV(TAG, "Increasing wiper %" PRIu8 "", wiper_idx);
|
ESP_LOGV(TAG, "Increasing wiper %" PRIu8 "", wiper_idx);
|
||||||
uint8_t reg = 0;
|
uint8_t reg = 0;
|
||||||
uint8_t addr;
|
uint8_t addr;
|
||||||
@@ -396,6 +400,10 @@ bool Mcp4461Component::decrease_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 false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (this->reg_[wiper_idx].state == 0) {
|
||||||
|
ESP_LOGV(TAG, "%s", "Minimum wiper level reached, further decrease of wiper %" PRIu8 " prohibited", wiper_idx);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
ESP_LOGV(TAG, "Decreasing wiper %" PRIu8 "", wiper_idx);
|
ESP_LOGV(TAG, "Decreasing wiper %" PRIu8 "", wiper_idx);
|
||||||
uint8_t reg = 0;
|
uint8_t reg = 0;
|
||||||
uint8_t addr;
|
uint8_t addr;
|
||||||
|
Reference in New Issue
Block a user