From b7a2e5050627ff618c2a97b707de89e4834e3146 Mon Sep 17 00:00:00 2001 From: BlackMark Date: Sat, 18 Jul 2026 10:10:47 +0200 Subject: [PATCH] Keep the curve and thermistor comments timeless Both headers described the port transformation ("legacy cubic becomes", "no hand-rolled series needed") rather than what the code is. State the cubic and the __builtin_log rationale directly. Co-Authored-By: Claude --- src/curve.hpp | 6 +++--- src/thermistor.hpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/curve.hpp b/src/curve.hpp index 44acbba..5dce19f 100644 --- a/src/curve.hpp +++ b/src/curve.hpp @@ -5,9 +5,9 @@ #include -// The auto-mode fan curve, tabulated at compile time: the legacy cubic -// (0.002246·x³ − 0.09·x² + 0.91·x, zero below 20 °C) becomes a libavr -// flash_table of duty percent per °C. +// The auto-mode fan curve, tabulated at compile time: a cubic in °C +// (0.002246·x³ − 0.09·x² + 0.91·x, zero below 20 °C) as a flash_table of +// duty percent per °C. namespace app::curve { namespace detail { diff --git a/src/thermistor.hpp b/src/thermistor.hpp index f24da85..3e0b469 100644 --- a/src/thermistor.hpp +++ b/src/thermistor.hpp @@ -21,8 +21,8 @@ namespace detail { consteval double temperature_of(double adc) { double resistance = series_resistor * adc / (1023.0 - adc); - // __builtin_log constant-folds on the AVR backend, so no runtime libm - // and no hand-rolled series is needed for the compile-time table. + // __builtin_log constant-folds on the AVR backend, so the table is + // built at compile time with no runtime libm. double steinhart = __builtin_log(resistance / nominal_resistance) / beta + 1.0 / (nominal_temperature + 273.15); return 1.0 / steinhart - 273.15; }