mirror of
https://github.com/esphome/esphome.git
synced 2025-11-20 00:35:44 +00:00
Run clang-tidy against Arduino 3 (#2146)
* Add macros header with more usable Arduino version defines * Change Arduino version checking to use our version defines * Add missing ESP8266 check * Rename Arduino version macro to ARDUINO_VERSION_CODE * Upgrade clang-tidy to use Arduino 3 * Fix clang-tidy warnings * Upgrade NeoPixelBus to upstream 2.6.7 * Use Arduino-version-appropriate API to set redirect flags * Remove now unnecessary CLANG_TIDY ifdefs * Add preprocessor hackery to avoid including pgmspace.h * Bump base image to 4.1.1 and update lint * Fix nfctag * Fix make_unique ambiguous * Fix ignore name * Fix ambiguous v2 * Remove unused begin * Cast time_t to prevent issues on platforms where time_t is 32bit Co-authored-by: Otto winter <otto@otto-winter.com>
This commit is contained in:
@@ -21,11 +21,11 @@ void DebugComponent::dump_config() {
|
||||
#endif
|
||||
|
||||
ESP_LOGD(TAG, "ESPHome version %s", ESPHOME_VERSION);
|
||||
this->free_heap_ = ESP.getFreeHeap();
|
||||
this->free_heap_ = ESP.getFreeHeap(); // NOLINT(readability-static-accessed-through-instance)
|
||||
ESP_LOGD(TAG, "Free Heap Size: %u bytes", this->free_heap_);
|
||||
|
||||
const char *flash_mode;
|
||||
switch (ESP.getFlashChipMode()) {
|
||||
switch (ESP.getFlashChipMode()) { // NOLINT(readability-static-accessed-through-instance)
|
||||
case FM_QIO:
|
||||
flash_mode = "QIO";
|
||||
break;
|
||||
@@ -49,6 +49,7 @@ void DebugComponent::dump_config() {
|
||||
default:
|
||||
flash_mode = "UNKNOWN";
|
||||
}
|
||||
// NOLINTNEXTLINE(readability-static-accessed-through-instance)
|
||||
ESP_LOGD(TAG, "Flash Chip: Size=%ukB Speed=%uMHz Mode=%s", ESP.getFlashChipSize() / 1024,
|
||||
ESP.getFlashChipSpeed() / 1000000, flash_mode);
|
||||
|
||||
@@ -87,7 +88,7 @@ void DebugComponent::dump_config() {
|
||||
|
||||
ESP_LOGD(TAG, "ESP-IDF Version: %s", esp_get_idf_version());
|
||||
|
||||
std::string mac = uint64_to_string(ESP.getEfuseMac());
|
||||
std::string mac = uint64_to_string(ESP.getEfuseMac()); // NOLINT(readability-static-accessed-through-instance)
|
||||
ESP_LOGD(TAG, "EFuse MAC: %s", mac.c_str());
|
||||
|
||||
const char *reset_reason;
|
||||
@@ -186,7 +187,7 @@ void DebugComponent::dump_config() {
|
||||
ESP_LOGD(TAG, "Wakeup Reason: %s", wakeup_reason);
|
||||
#endif
|
||||
|
||||
#ifdef ARDUINO_ARCH_ESP8266
|
||||
#if defined(ARDUINO_ARCH_ESP8266) && !defined(CLANG_TIDY)
|
||||
ESP_LOGD(TAG, "Chip ID: 0x%08X", ESP.getChipId());
|
||||
ESP_LOGD(TAG, "SDK Version: %s", ESP.getSdkVersion());
|
||||
ESP_LOGD(TAG, "Core Version: %s", ESP.getCoreVersion().c_str());
|
||||
@@ -198,7 +199,7 @@ void DebugComponent::dump_config() {
|
||||
#endif
|
||||
}
|
||||
void DebugComponent::loop() {
|
||||
uint32_t new_free_heap = ESP.getFreeHeap();
|
||||
uint32_t new_free_heap = ESP.getFreeHeap(); // NOLINT(readability-static-accessed-through-instance)
|
||||
if (new_free_heap < this->free_heap_ / 2) {
|
||||
this->free_heap_ = new_free_heap;
|
||||
ESP_LOGD(TAG, "Free Heap Size: %u bytes", this->free_heap_);
|
||||
|
||||
Reference in New Issue
Block a user