1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-12 08:12:22 +01: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:
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

View File

@@ -233,7 +233,7 @@ void ESP8266SoftwareSerial::setup(int8_t tx_pin, int8_t rx_pin, uint32_t baud_ra
}
void ICACHE_RAM_ATTR ESP8266SoftwareSerial::gpio_intr(ESP8266SoftwareSerial *arg) {
uint32_t wait = arg->bit_time_ + arg->bit_time_ / 3 - 500;
const uint32_t start = ESP.getCycleCount();
const uint32_t start = ESP.getCycleCount(); // NOLINT(readability-static-accessed-through-instance)
uint8_t rec = 0;
// Manually unroll the loop
for (int i = 0; i < arg->data_bits_; i++)
@@ -273,7 +273,7 @@ void ICACHE_RAM_ATTR HOT ESP8266SoftwareSerial::write_byte(uint8_t data) {
{
InterruptLock lock;
uint32_t wait = this->bit_time_;
const uint32_t start = ESP.getCycleCount();
const uint32_t start = ESP.getCycleCount(); // NOLINT(readability-static-accessed-through-instance)
// Start bit
this->write_bit_(false, &wait, start);
for (int i = 0; i < this->data_bits_; i++) {
@@ -291,7 +291,7 @@ void ICACHE_RAM_ATTR HOT ESP8266SoftwareSerial::write_byte(uint8_t data) {
}
}
void ICACHE_RAM_ATTR ESP8266SoftwareSerial::wait_(uint32_t *wait, const uint32_t &start) {
while (ESP.getCycleCount() - start < *wait)
while (ESP.getCycleCount() - start < *wait) // NOLINT(readability-static-accessed-through-instance)
;
*wait += this->bit_time_;
}