Don't use temprature_sens_read on ESP32S2

This commit is contained in:
fvanroie 2021-10-27 15:39:16 +02:00
parent 9c65a63ee5
commit 76257add50
2 changed files with 6 additions and 0 deletions

View File

@ -20,7 +20,9 @@
#define BACKLIGHT_CHANNEL 0
#ifndef ESP32S2
uint8_t temprature_sens_read();
#endif
namespace dev {
@ -304,9 +306,11 @@ void Esp32Device::get_info(JsonDocument& doc)
void Esp32Device::get_sensors(JsonDocument& doc)
{
#ifndef ESP32S2
JsonObject sensor = doc.createNestedObject(F("ESP32"));
uint32_t temp = (temprature_sens_read() - 32) * 100 / 1.8;
sensor[F("Temperature")] = serialized(String(1.0f * temp / 100, 2));
#endif
}
long Esp32Device::get_uptime()

View File

@ -13,7 +13,9 @@
extern "C" {
#endif
#ifndef ESP32S2
uint8_t temprature_sens_read();
#endif
#ifdef __cplusplus
}