1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-19 03:32:20 +01:00

Fix SN74HC595 doesn't use ESPHome HAL and add lint checks for it (#1188)

This commit is contained in:
Otto Winter
2020-07-25 14:22:56 +02:00
committed by GitHub
parent 55388724af
commit 0fc8e8d483
7 changed files with 105 additions and 37 deletions

View File

@@ -58,7 +58,7 @@ void ADCSensor::update() {
}
float ADCSensor::sample() {
#ifdef ARDUINO_ARCH_ESP32
float value_v = analogRead(this->pin_) / 4095.0f;
float value_v = analogRead(this->pin_) / 4095.0f; // NOLINT
switch (this->attenuation_) {
case ADC_0db:
value_v *= 1.1;
@@ -80,7 +80,7 @@ float ADCSensor::sample() {
#ifdef USE_ADC_SENSOR_VCC
return ESP.getVcc() / 1024.0f;
#else
return analogRead(this->pin_) / 1024.0f;
return analogRead(this->pin_) / 1024.0f; // NOLINT
#endif
#endif
}