mirror of
https://github.com/tbnobody/OpenDTU.git
synced 2025-12-10 16:59:52 +01:00
CPU temperature: make boolean value human-readable in serial log
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
#include "CpuTemperature.h"
|
||||
#include <Arduino.h>
|
||||
|
||||
#undef TAG
|
||||
static const char* TAG = "temperature";
|
||||
|
||||
#if defined(CONFIG_IDF_TARGET_ESP32)
|
||||
// there is no official API available on the original ESP32
|
||||
extern "C" {
|
||||
@@ -52,7 +55,7 @@ float CpuTemperatureClass::read()
|
||||
if (success && std::isfinite(temperature)) {
|
||||
return temperature;
|
||||
} else {
|
||||
ESP_LOGD(TAG, "Ignoring invalid temperature (success=%" PRId8 ", value=%.1f)", success, temperature);
|
||||
ESP_LOGD(TAG, "Ignoring invalid temperature (success=%s, value=%.1f)", (success ? "true" : "false"), temperature);
|
||||
return NAN;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user