mirror of
https://github.com/esphome/esphome.git
synced 2025-04-16 07:40:29 +01:00
Fix formatting
This commit is contained in:
parent
28e663e7c3
commit
5a46916594
@ -108,11 +108,7 @@ bool MCP3428Component::request_measurement(MCP3428Multiplexer multiplexer, MCP34
|
|||||||
this->last_config_write_ms_ = millis();
|
this->last_config_write_ms_ = millis();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->continuous_mode_) {
|
this->single_measurement_active_ = !this->continuous_mode_;
|
||||||
this->single_measurement_active_ = false;
|
|
||||||
} else {
|
|
||||||
this->single_measurement_active_ = true;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,7 +121,7 @@ bool MCP3428Component::poll_result(float &voltage) {
|
|||||||
}
|
}
|
||||||
if ((anwser[2] & 0b10000000) == 0) {
|
if ((anwser[2] & 0b10000000) == 0) {
|
||||||
// ready flag is 0, valid measurement received
|
// ready flag is 0, valid measurement received
|
||||||
voltage = this->convert_anwser_to_voltage(anwser);
|
voltage = this->convert_anwser_to_voltage_(anwser);
|
||||||
single_measurement_active_ = false;
|
single_measurement_active_ = false;
|
||||||
this->status_clear_warning();
|
this->status_clear_warning();
|
||||||
return true;
|
return true;
|
||||||
@ -134,7 +130,7 @@ bool MCP3428Component::poll_result(float &voltage) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float MCP3428Component::convert_anwser_to_voltage(uint8_t *anwser) {
|
float MCP3428Component::convert_anwser_to_voltage_(uint8_t *anwser) {
|
||||||
uint8_t config_resolution = (this->prev_config_ >> 2) & 0b00000011;
|
uint8_t config_resolution = (this->prev_config_ >> 2) & 0b00000011;
|
||||||
uint8_t config_gain = this->prev_config_ & 0b00000011;
|
uint8_t config_gain = this->prev_config_ & 0b00000011;
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ class MCP3428Component : public Component, public i2c::I2CDevice {
|
|||||||
void abandon_current_measurement() { single_measurement_active_ = false; }
|
void abandon_current_measurement() { single_measurement_active_ = false; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
float convert_anwser_to_voltage(uint8_t *anwser);
|
float convert_anwser_to_voltage_(uint8_t *anwser);
|
||||||
|
|
||||||
uint8_t prev_config_{0};
|
uint8_t prev_config_{0};
|
||||||
uint32_t last_config_write_ms_{0};
|
uint32_t last_config_write_ms_{0};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user