mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-13 16:13:32 +02:00
Avoid non-const globals and enable clang-tidy check (#1892)
This commit is contained in:
@@ -5,9 +5,9 @@
|
||||
namespace esphome {
|
||||
namespace status_led {
|
||||
|
||||
static const char *TAG = "status_led";
|
||||
static const char *const TAG = "status_led";
|
||||
|
||||
StatusLED *global_status_led = nullptr;
|
||||
StatusLED *global_status_led = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||
|
||||
StatusLED::StatusLED(GPIOPin *pin) : pin_(pin) { global_status_led = this; }
|
||||
void StatusLED::pre_setup() {
|
||||
|
||||
@@ -20,7 +20,7 @@ class StatusLED : public Component {
|
||||
GPIOPin *pin_;
|
||||
};
|
||||
|
||||
extern StatusLED *global_status_led;
|
||||
extern StatusLED *global_status_led; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||
|
||||
} // namespace status_led
|
||||
} // namespace esphome
|
||||
|
||||
Reference in New Issue
Block a user