From f59cea3be9eed8d63fa44d4fd360c9c68e9318f6 Mon Sep 17 00:00:00 2001 From: Luke Hoersten Date: Wed, 15 Jul 2026 19:18:32 -0500 Subject: temp: report on-die temperature in /state and the info screen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- main/chip_temp.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 main/chip_temp.h (limited to 'main/chip_temp.h') diff --git a/main/chip_temp.h b/main/chip_temp.h new file mode 100644 index 0000000..ef3e792 --- /dev/null +++ b/main/chip_temp.h @@ -0,0 +1,12 @@ +#pragma once + +#include "esp_err.h" + +// On-die temperature sensor (ESP32-P4 TSENS). Init once at boot; reads are +// cheap (~µs) and safe from any task. Note this is junction temperature — +// expect ~10-20°C above ambient under load; useful for trending and +// thermal-throttle debugging, not room temperature. +esp_err_t chip_temp_init(void); + +// Degrees Celsius, or NAN if the sensor isn't initialized / read failed. +float chip_temp_read(void); -- cgit v1.2.3