aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2021-08-19 04:49:45 -0600
committerSelene ToyKeeper2021-08-19 04:49:45 -0600
commit93143921162e9b3d1159899d6e4dcd0c37403f82 (patch)
tree5499031c5464908e65255c5f18edeba51a7f80c4
parentfixed spurious warnings in level_calc on multi-channel lights (diff)
parentadded #define USE_THERM_AUTOCALIBRATE to opt out (diff)
downloadanduril-93143921162e9b3d1159899d6e4dcd0c37403f82.tar.gz
anduril-93143921162e9b3d1159899d6e4dcd0c37403f82.tar.bz2
anduril-93143921162e9b3d1159899d6e4dcd0c37403f82.zip
merged digitalcircuit's anduril2_opt_disable_autocal_therm branch,
allowing configs to disable the thermal autocalibration feature
-rw-r--r--spaghetti-monster/anduril/config-default.h14
-rw-r--r--spaghetti-monster/anduril/factory-reset.c2
2 files changed, 14 insertions, 2 deletions
diff --git a/spaghetti-monster/anduril/config-default.h b/spaghetti-monster/anduril/config-default.h
index 31fcbf4..a50be5d 100644
--- a/spaghetti-monster/anduril/config-default.h
+++ b/spaghetti-monster/anduril/config-default.h
@@ -37,7 +37,19 @@
// overheat protection
#define USE_THERMAL_REGULATION
#define DEFAULT_THERM_CEIL 45 // try not to get hotter than this (in C)
-
+// Comment out to disable automatic calibration on factory reset
+// - If so, be sure to set THERM_CAL_OFFSET to the correct calibration offset
+// - Calibration can still be overridden in temperature check mode
+// Or uncomment to use the default auto-calibrate on factory reset
+//
+// To determine THERM_CAL_OFFSET, comment out USE_THERM_AUTOCALIBRATE to
+// disable auto-calibration, compile and flash, let flashlight rest at a known
+// temperature, then enter temp check mode (do NOT enter calibration mode).
+//
+// THERM_CAL_OFFSET = known_temperature - temp_check_blinks + THERM_CAL_OFFSET
+//
+// (include THERM_CAL_OFFSET in sum as it might already be a non-zero number)
+#define USE_THERM_AUTOCALIBRATE
// Include a simplified UI for non-enthusiasts?
#define USE_SIMPLE_UI
diff --git a/spaghetti-monster/anduril/factory-reset.c b/spaghetti-monster/anduril/factory-reset.c
index c327e65..5377b09 100644
--- a/spaghetti-monster/anduril/factory-reset.c
+++ b/spaghetti-monster/anduril/factory-reset.c
@@ -43,7 +43,7 @@ void factory_reset() {
}
// explode, if button pressed long enough
if (reset) {
- #ifdef USE_THERMAL_REGULATION
+ #if defined(USE_THERMAL_REGULATION) && defined(USE_THERM_AUTOCALIBRATE)
// auto-calibrate temperature... assume current temperature is 21 C
thermal_config_save(1, 21);
#endif