From 1e9dc049bf9df8b1b7712d280c2e77f3b7f69a51 Mon Sep 17 00:00:00 2001 From: Joey Castillo Date: Sat, 17 May 2025 22:06:11 -0400 Subject: [PATCH] clean up after detecting thermistor --- watch-library/shared/driver/thermistor_driver.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/watch-library/shared/driver/thermistor_driver.c b/watch-library/shared/driver/thermistor_driver.c index 0b6839e4..1a76d805 100644 --- a/watch-library/shared/driver/thermistor_driver.c +++ b/watch-library/shared/driver/thermistor_driver.c @@ -68,6 +68,13 @@ bool thermistor_driver_init(void) { // value should be >15000 and <55000 and (between -4° and 76° C) if (value < 15000 || value > 55000) has_thermistor = false; + // clean up, disable everything we enabled earlier. + watch_disable_adc(); + HAL_GPIO_TEMPSENSE_off(); + HAL_GPIO_TEMPSENSE_pmuxdis(); + HAL_GPIO_TS_ENABLE_write(!THERMISTOR_ENABLE_VALUE); + HAL_GPIO_TS_ENABLE_off(); + return has_thermistor; }