mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-11 18:54:28 +05:00
fix: polling ntc on esp8266 fixed
This commit is contained in:
@@ -361,7 +361,12 @@ protected:
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef ARDUINO_ARCH_ESP32
|
||||||
const auto value = analogReadMilliVolts(sSensor.gpio);
|
const auto value = analogReadMilliVolts(sSensor.gpio);
|
||||||
|
#else
|
||||||
|
const auto value = analogRead(sSensor.gpio) / 1023 * DEFAULT_NTC_VREF;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (value < DEFAULT_NTC_VLOW_TRESHOLD) {
|
if (value < DEFAULT_NTC_VLOW_TRESHOLD) {
|
||||||
if (Sensors::getConnectionStatusById(sensorId)) {
|
if (Sensors::getConnectionStatusById(sensorId)) {
|
||||||
Sensors::setConnectionStatusById(sensorId, false, false);
|
Sensors::setConnectionStatusById(sensorId, false, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user