mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-06 21:09:53 +02:00
Avoid non-const globals and enable clang-tidy check (#1892)
This commit is contained in:
@@ -13,9 +13,10 @@
|
||||
namespace esphome {
|
||||
namespace vl53l0x {
|
||||
|
||||
static const char *TAG = "vl53l0x";
|
||||
std::list<VL53L0XSensor *> VL53L0XSensor::vl53_sensors;
|
||||
bool VL53L0XSensor::enable_pin_setup_complete = false;
|
||||
static const char *const TAG = "vl53l0x";
|
||||
|
||||
std::list<VL53L0XSensor *> VL53L0XSensor::vl53_sensors; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||
bool VL53L0XSensor::enable_pin_setup_complete = false; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||
|
||||
VL53L0XSensor::VL53L0XSensor() { VL53L0XSensor::vl53_sensors.push_back(this); }
|
||||
|
||||
|
||||
@@ -264,8 +264,8 @@ class VL53L0XSensor : public sensor::Sensor, public PollingComponent, public i2c
|
||||
uint16_t timeout_start_us_;
|
||||
uint16_t timeout_us_{};
|
||||
|
||||
static std::list<VL53L0XSensor *> vl53_sensors;
|
||||
static bool enable_pin_setup_complete;
|
||||
static std::list<VL53L0XSensor *> vl53_sensors; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||
static bool enable_pin_setup_complete; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||
};
|
||||
|
||||
} // namespace vl53l0x
|
||||
|
||||
Reference in New Issue
Block a user