aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShane Synan2021-07-13 19:44:08 -0400
committerShane Synan2021-07-13 19:44:08 -0400
commit68ffcea4e3fb2b544501725f5de8fbb304369f64 (patch)
tree95f92f4e156d9025adb27620c4b9f30ea4c8050a
parentrewrote hybrid memory (manual memory timer) to eliminate corner cases (diff)
downloadanduril-68ffcea4e3fb2b544501725f5de8fbb304369f64.tar.gz
anduril-68ffcea4e3fb2b544501725f5de8fbb304369f64.tar.bz2
anduril-68ffcea4e3fb2b544501725f5de8fbb304369f64.zip
added #define USE_THERM_AUTOCALIBRATE to opt out
Moved factory reset thermal auto-calibration behind a new default-on config #define USE_THERM_AUTOCALIBRATE. Commenting this out or the usual #ifdef/#undef in a cfg-[...].h build file allows for manually calibrating the temperature offset. This may be useful for factory-calibrated temperature sensors or for those who regularly flash custom builds and don't want to recalibrate each time. Determining the correct temperature offset for a given flashlight first requires flashing a build with auto-calibrate disabled, using that to determine the offset, which can then be baked in to future firmware builds.
-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
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.