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
b6a5f49b3c
commit
353c2aa2dd
@ -22,7 +22,7 @@ void Mcp4461Component::setup() {
|
||||
|
||||
void Mcp4461Component::begin_() {
|
||||
// save WP/WL status
|
||||
this->set_write_protection_status_();
|
||||
this->update_write_protection_status_();
|
||||
for (uint8_t i = 0; i < 8; i++) {
|
||||
if (this->reg_[i].initial_value.has_value()) {
|
||||
uint16_t initial_state;
|
||||
@ -76,7 +76,7 @@ void Mcp4461Component::set_initial_value(Mcp4461WiperIdx wiper, float initial_va
|
||||
this->reg_[wiper_id].initial_value = initial_value;
|
||||
}
|
||||
|
||||
void Mcp4461Component::set_write_protection_status_() {
|
||||
void Mcp4461Component::update_write_protection_status_() {
|
||||
uint8_t status_register_value;
|
||||
status_register_value = this->get_status_register();
|
||||
this->write_protected_ = static_cast<bool>((status_register_value >> 0) & 0x01);
|
||||
|
Loading…
x
Reference in New Issue
Block a user