mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-29 06:06:40 +00:00
Don't use temprature_sens_read on ESP32S2
This commit is contained in:
parent
9c65a63ee5
commit
76257add50
@ -20,7 +20,9 @@
|
|||||||
|
|
||||||
#define BACKLIGHT_CHANNEL 0
|
#define BACKLIGHT_CHANNEL 0
|
||||||
|
|
||||||
|
#ifndef ESP32S2
|
||||||
uint8_t temprature_sens_read();
|
uint8_t temprature_sens_read();
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace dev {
|
namespace dev {
|
||||||
|
|
||||||
@ -304,9 +306,11 @@ void Esp32Device::get_info(JsonDocument& doc)
|
|||||||
|
|
||||||
void Esp32Device::get_sensors(JsonDocument& doc)
|
void Esp32Device::get_sensors(JsonDocument& doc)
|
||||||
{
|
{
|
||||||
|
#ifndef ESP32S2
|
||||||
JsonObject sensor = doc.createNestedObject(F("ESP32"));
|
JsonObject sensor = doc.createNestedObject(F("ESP32"));
|
||||||
uint32_t temp = (temprature_sens_read() - 32) * 100 / 1.8;
|
uint32_t temp = (temprature_sens_read() - 32) * 100 / 1.8;
|
||||||
sensor[F("Temperature")] = serialized(String(1.0f * temp / 100, 2));
|
sensor[F("Temperature")] = serialized(String(1.0f * temp / 100, 2));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
long Esp32Device::get_uptime()
|
long Esp32Device::get_uptime()
|
||||||
|
@ -13,7 +13,9 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef ESP32S2
|
||||||
uint8_t temprature_sens_read();
|
uint8_t temprature_sens_read();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user