sanity check for power

This commit is contained in:
2026-05-23 18:08:29 +00:00
parent b17c02127e
commit 4777d51107

View File

@@ -40,6 +40,8 @@ void cpu_update(struct cpu_sensors_t *c) {
c->ptotal = (float)(curr.energy - prev.energy) / (float)timespec_diff_us(&curr.ts, &prev.ts);
prev = curr;
if (c->ptotal > 500.0f || c->ptotal < 0.0f)
c->ptotal = 0.0f;
// lots of reads but still faster than reading /proc/cpuinfo
c->avg_freq = 0;