mirror of
https://github.com/esphome/esphome.git
synced 2026-09-03 19:46:02 +00:00
[mcp3204] Combine log statements to reduce loop blocking (#12912)
This commit is contained in:
@@ -11,9 +11,11 @@ float MCP3204::get_setup_priority() const { return setup_priority::HARDWARE; }
|
||||
void MCP3204::setup() { this->spi_setup(); }
|
||||
|
||||
void MCP3204::dump_config() {
|
||||
ESP_LOGCONFIG(TAG, "MCP3204:");
|
||||
ESP_LOGCONFIG(TAG,
|
||||
"MCP3204:\n"
|
||||
" Reference Voltage: %.2fV",
|
||||
this->reference_voltage_);
|
||||
LOG_PIN(" CS Pin:", this->cs_);
|
||||
ESP_LOGCONFIG(TAG, " Reference Voltage: %.2fV", this->reference_voltage_);
|
||||
}
|
||||
|
||||
float MCP3204::read_data(uint8_t pin, bool differential) {
|
||||
|
||||
@@ -11,8 +11,10 @@ float MCP3204Sensor::get_setup_priority() const { return setup_priority::DATA; }
|
||||
|
||||
void MCP3204Sensor::dump_config() {
|
||||
LOG_SENSOR("", "MCP3204 Sensor", this);
|
||||
ESP_LOGCONFIG(TAG, " Pin: %u", this->pin_);
|
||||
ESP_LOGCONFIG(TAG, " Differential Mode: %s", YESNO(this->differential_mode_));
|
||||
ESP_LOGCONFIG(TAG,
|
||||
" Pin: %u\n"
|
||||
" Differential Mode: %s",
|
||||
this->pin_, YESNO(this->differential_mode_));
|
||||
LOG_UPDATE_INTERVAL(this);
|
||||
}
|
||||
float MCP3204Sensor::sample() { return this->parent_->read_data(this->pin_, this->differential_mode_); }
|
||||
|
||||
Reference in New Issue
Block a user