Conforming to CLANG 2

This commit is contained in:
markodraca 2024-09-12 18:40:47 +02:00
parent 543a4ba7a4
commit 9b3fd47247
3 changed files with 9 additions and 21 deletions

View file

@ -20,7 +20,6 @@ void MCP3204::dump_config() {
}
float MCP3204::read_data(uint8_t channel, bool differential) {
uint8_t command, sgldiff;
uint8_t b0, b1, b2;

View file

@ -8,17 +8,12 @@ namespace esphome {
namespace mcp3204 {
class MCP3204 : public Component,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST,
spi::CLOCK_POLARITY_LOW,
spi::CLOCK_PHASE_LEADING,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW, spi::CLOCK_PHASE_LEADING,
spi::DATA_RATE_1MHZ> {
public:
MCP3204() = default;
void set_reference_voltage(float reference_voltage)
{
this->reference_voltage_ = reference_voltage;
}
void set_reference_voltage(float reference_voltage) { this->reference_voltage_ = reference_voltage; }
void setup() override;
void dump_config() override;

View file

@ -17,14 +17,8 @@ void MCP3204Sensor::dump_config() {
ESP_LOGCONFIG(TAG, " DIFFERENTIAL MODE: %u", this->diffmode_);
LOG_UPDATE_INTERVAL(this);
}
float MCP3204Sensor::sample()
{
return this->parent_->read_data(this->pin_, this->diffmode_);
}
void MCP3204Sensor::update()
{
this->publish_state(this->sample());
}
float MCP3204Sensor::sample() { return this->parent_->read_data(this->pin_, this->diffmode_); }
void MCP3204Sensor::update() { this->publish_state(this->sample()); }
} // namespace mcp3204
} // namespace esphome