mirror of
https://github.com/esphome/esphome.git
synced 2025-09-13 08:42:18 +01:00
Run clang-tidy against ESP32 (#2147)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Co-authored-by: Otto winter <otto@otto-winter.com>
This commit is contained in:
@@ -45,10 +45,11 @@ pulse_counter_t PulseCounterStorage::read_raw_value() {
|
||||
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
bool PulseCounterStorage::pulse_counter_setup(GPIOPin *pin) {
|
||||
static pcnt_unit_t next_pcnt_unit = PCNT_UNIT_0;
|
||||
this->pin = pin;
|
||||
this->pin->setup();
|
||||
this->pcnt_unit = next_pcnt_unit;
|
||||
next_pcnt_unit = pcnt_unit_t(int(next_pcnt_unit) + 1); // NOLINT
|
||||
next_pcnt_unit = pcnt_unit_t(int(next_pcnt_unit) + 1);
|
||||
|
||||
ESP_LOGCONFIG(TAG, " PCNT Unit Number: %u", this->pcnt_unit);
|
||||
|
||||
@@ -166,9 +167,5 @@ void PulseCounterSensor::update() {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
pcnt_unit_t next_pcnt_unit = PCNT_UNIT_0;
|
||||
#endif
|
||||
|
||||
} // namespace pulse_counter
|
||||
} // namespace esphome
|
||||
|
@@ -69,9 +69,5 @@ class PulseCounterSensor : public sensor::Sensor, public PollingComponent {
|
||||
sensor::Sensor *total_sensor_;
|
||||
};
|
||||
|
||||
#ifdef ARDUINO_ARCH_ESP32
|
||||
extern pcnt_unit_t next_pcnt_unit;
|
||||
#endif
|
||||
|
||||
} // namespace pulse_counter
|
||||
} // namespace esphome
|
||||
|
Reference in New Issue
Block a user