From 7f225886c996cc8fefa085eccdf5de220b693951 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Thu, 12 Dec 2024 12:12:57 +0100 Subject: [PATCH] clang-tidy --- esphome/components/adc/adc_sensor.h | 4 ++-- esphome/components/adc/adc_sensor_esp32_v5.cpp | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/esphome/components/adc/adc_sensor.h b/esphome/components/adc/adc_sensor.h index 22b8f2dbef..25aca9cf19 100644 --- a/esphome/components/adc/adc_sensor.h +++ b/esphome/components/adc/adc_sensor.h @@ -204,8 +204,8 @@ class ADCSensor : public sensor::Sensor, public PollingComponent, public voltage bool config_complete_{false}; bool handle_init_complete_{false}; bool calibration_complete_{false}; - static adc_oneshot_unit_handle_t shared_adc1_handle_; - static adc_oneshot_unit_handle_t shared_adc2_handle_; + static adc_oneshot_unit_handle_t shared_adc1_handle; + static adc_oneshot_unit_handle_t shared_adc2_handle; #else adc_atten_t attenuation_{ADC_ATTEN_DB_0}; adc1_channel_t channel1_{ADC1_CHANNEL_MAX}; diff --git a/esphome/components/adc/adc_sensor_esp32_v5.cpp b/esphome/components/adc/adc_sensor_esp32_v5.cpp index 6981661204..6570b9d735 100644 --- a/esphome/components/adc/adc_sensor_esp32_v5.cpp +++ b/esphome/components/adc/adc_sensor_esp32_v5.cpp @@ -10,8 +10,8 @@ namespace adc { static const char *const TAG = "adc.esp32"; -adc_oneshot_unit_handle_t ADCSensor::shared_adc1_handle_ = nullptr; -adc_oneshot_unit_handle_t ADCSensor::shared_adc2_handle_ = nullptr; +adc_oneshot_unit_handle_t ADCSensor::shared_adc1_handle = nullptr; +adc_oneshot_unit_handle_t ADCSensor::shared_adc2_handle = nullptr; void ADCSensor::setup() { ESP_LOGCONFIG(TAG, "Setting up ADC '%s'...", this->get_name().c_str()); @@ -28,8 +28,8 @@ void ADCSensor::setup() { if (this->is_adc1_) { if (this->adc1_handle_ == nullptr) { // Check if another sensor already initialized ADC1 - if (shared_adc1_handle_ != nullptr) { - this->adc1_handle_ = shared_adc1_handle_; + if (shared_adc1_handle != nullptr) { + this->adc1_handle_ = shared_adc1_handle; this->handle_init_complete_ = true; } else { adc_oneshot_unit_init_cfg_t init_config1 = {}; @@ -45,7 +45,7 @@ void ADCSensor::setup() { this->mark_failed(); return; } - shared_adc1_handle_ = this->adc1_handle_; + shared_adc1_handle = this->adc1_handle_; this->handle_init_complete_ = true; } } @@ -66,8 +66,8 @@ void ADCSensor::setup() { } else { if (this->adc2_handle_ == nullptr) { // Check if another sensor already initialized ADC2 - if (shared_adc2_handle_ != nullptr) { - this->adc2_handle_ = shared_adc2_handle_; + if (shared_adc2_handle != nullptr) { + this->adc2_handle_ = shared_adc2_handle; this->handle_init_complete_ = true; } else { adc_oneshot_unit_init_cfg_t init_config2 = {}; @@ -83,7 +83,7 @@ void ADCSensor::setup() { this->mark_failed(); return; } - shared_adc2_handle_ = this->adc2_handle_; + shared_adc2_handle = this->adc2_handle_; this->handle_init_complete_ = true; } }