src.nth.io/

summaryrefslogtreecommitdiff
path: root/main/local_screens.c
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2026-07-15 19:18:32 -0500
committerLuke Hoersten <[email protected]>2026-07-15 19:18:32 -0500
commitf59cea3be9eed8d63fa44d4fd360c9c68e9318f6 (patch)
tree699a0b554d04600520505c9e5bf835f89663af9f /main/local_screens.c
parent659da7f36473a21494693f031a39fb6bb977b90a (diff)
temp: report on-die temperature in /state and the info screen
New chip_temp module wraps the ESP32-P4 TSENS driver (20-100C range for best accuracy in the warm band a PoE + 200MHz-PSRAM device lives in). /state gains temp_c (0.1C resolution, omitted when the sensor is unavailable); the long-press info overlay gains a temp line (lowercase c suffix — the local 8x8 font has no uppercase C). Junction temperature, ~10-20C above ambient under load.
Diffstat (limited to 'main/local_screens.c')
-rw-r--r--main/local_screens.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main/local_screens.c b/main/local_screens.c
index 5c72f26..751ac91 100644
--- a/main/local_screens.c
+++ b/main/local_screens.c
@@ -1,11 +1,13 @@
#include "local_screens.h"
+#include <math.h>
#include <string.h>
#include "esp_heap_caps.h"
#include "esp_log.h"
#include "esp_timer.h"
+#include "chip_temp.h"
#include "display.h"
#include "net_eth.h"
#include "viewport_state.h"
@@ -310,6 +312,8 @@ esp_err_t local_screens_show_info(void)
ADD("errs %llu", (unsigned long long)(decode_err + post_err));
ADD("heap %s", heap_str);
ADD("psram %s", psram_str);
+ float temp_c = chip_temp_read(); // on-die junction temp; skip if n/a
+ if (!isnan(temp_c)) ADD("temp %.1fc", (double)temp_c);
#undef ADD