mirror of
https://github.com/esphome/esphome.git
synced 2024-11-27 17:27:59 +01:00
Conforming to CLANG 2
This commit is contained in:
parent
543a4ba7a4
commit
9b3fd47247
3 changed files with 9 additions and 21 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue