From 3a2798207e2e4b720ff762d3dc8196b877419b7e Mon Sep 17 00:00:00 2001 From: Tom Schumm Date: Sat, 24 Aug 2024 20:34:10 -0700 Subject: [PATCH] Adds THERM_AUTOCALIBRATE_TEMP option. Configures the assumed temperature (default 21C) when performing thermal autocalibration during a factory reset. --- ui/anduril/factory-reset.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/anduril/factory-reset.c b/ui/anduril/factory-reset.c index a315c5b5..5f9175f3 100644 --- a/ui/anduril/factory-reset.c +++ b/ui/anduril/factory-reset.c @@ -45,7 +45,10 @@ void factory_reset() { thermal_config_save(1, temperature - cfg.therm_cal_offset); #elif defined(USE_THERMAL_REGULATION) && defined(USE_THERM_AUTOCALIBRATE) // assume current temperature is 21 C - thermal_config_save(1, 21); + #ifndef THERM_AUTOCALIBRATE_TEMP + #define THERM_AUTOCALIBRATE_TEMP 21 + #endif + thermal_config_save(1, THERM_AUTOCALIBRATE_TEMP); #endif // save all settings to eeprom