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:
Oxan van Leeuwen
2021-09-13 18:55:04 +02:00
committed by GitHub
parent ed7983af41
commit 924df1e7de
30 changed files with 98 additions and 66 deletions
+2 -2
View File
@@ -127,7 +127,7 @@ void Application::reboot() {
ESP_LOGI(TAG, "Forcing a reboot...");
for (auto *comp : this->components_)
comp->on_shutdown();
ESP.restart();
ESP.restart(); // NOLINT(readability-static-accessed-through-instance)
// restart() doesn't always end execution
while (true) {
yield();
@@ -139,7 +139,7 @@ void Application::safe_reboot() {
comp->on_safe_shutdown();
for (auto *comp : this->components_)
comp->on_shutdown();
ESP.restart();
ESP.restart(); // NOLINT(readability-static-accessed-through-instance)
// restart() doesn't always end execution
while (true) {
yield();
+3 -1
View File
@@ -6,7 +6,9 @@ namespace esphome {
static const char *const TAG = "app_esp8266";
void ICACHE_RAM_ATTR HOT Application::feed_wdt_arch_() { ESP.wdtFeed(); }
void ICACHE_RAM_ATTR HOT Application::feed_wdt_arch_() {
ESP.wdtFeed(); // NOLINT(readability-static-accessed-through-instance)
}
} // namespace esphome
#endif
-7
View File
@@ -12,13 +12,6 @@
#include "esphome/core/optional.h"
#ifdef CLANG_TIDY
#undef ICACHE_RAM_ATTR
#define ICACHE_RAM_ATTR
#undef ICACHE_RODATA_ATTR
#define ICACHE_RODATA_ATTR
#endif
#define HOT __attribute__((hot))
#define ESPDEPRECATED(msg, when) __attribute__((deprecated(msg)))
#define ALWAYS_INLINE __attribute__((always_inline))
+2 -2
View File
@@ -75,12 +75,12 @@ static const uint8_t WEBSERVER_PORT = 80;
#ifdef USE_MDNS
#ifdef ARDUINO_ARCH_ESP8266
void network_setup_mdns(IPAddress address, int interface) {
void network_setup_mdns(const IPAddress &address, int interface) {
// Latest arduino framework breaks mDNS for AP interface
// see https://github.com/esp8266/Arduino/issues/6114
if (interface == 1)
return;
MDNS.begin(App.get_name().c_str(), std::move(address));
MDNS.begin(App.get_name().c_str(), address);
mdns_setup = true;
#endif
#ifdef ARDUINO_ARCH_ESP32
+1 -1
View File
@@ -21,7 +21,7 @@ bool remote_is_connected();
/// Manually set up the network stack (outside of the App.setup() loop, for example in OTA safe mode)
#ifdef ARDUINO_ARCH_ESP8266
void network_setup_mdns(IPAddress address, int interface);
void network_setup_mdns(const IPAddress &address, int interface);
#endif
#ifdef ARDUINO_ARCH_ESP32
void network_setup_mdns();