f6dfa80b19
- aes67_health: status.temps = [{name, c, min_c, max_c, warn_c}]
(0.1 °C), sampled every 2 s by a health task. On-die "SoC" sensor via
driver/temperature_sensor.h, range 20..100 °C, warn at 85 °C.
health_temp_register(name, read_cb, warn_c) for board sensors.
Warning logged when crossing warn_c, cleared below warn_c - 5 °C.
- Verified: SoC 26-28 °C at idle with min/max since boot; with a
temporary 27 °C threshold the warning was logged and arrived via
syslog as <132>, status carried warn_c 27.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
15 lines
682 B
C
15 lines
682 B
C
// aes67_health: Uptime, heap/PSRAM, temperature sensors (temps[] with min/max/warn).
|
|
// Core component: must not depend on main/ (project code).
|
|
#pragma once
|
|
|
|
#include "esp_err.h"
|
|
|
|
// Read one temperature in °C. Return ESP_OK on success.
|
|
typedef esp_err_t (*health_temp_read_cb_t)(float *celsius);
|
|
|
|
// Registers the health fields (fw, uptime_s, heap_free, psram_free, temps) in /api/status,
|
|
// adds the on-die "SoC" sensor and starts the 2 s sampling task.
|
|
esp_err_t aes67_health_init(void);
|
|
// Add a temperature sensor (e.g. an external I2C one from the board). warn_c <= 0: no warning.
|
|
esp_err_t health_temp_register(const char *name, health_temp_read_cb_t read, float warn_c);
|