From 970d0ea2a3f4a345989129bd5892bf55eeb541a1 Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Mon, 16 Aug 2021 00:34:23 +0100 Subject: [PATCH] AP_BoardConfig: make sure heater is left off if disabled --- libraries/AP_BoardConfig/IMU_heater.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/AP_BoardConfig/IMU_heater.cpp b/libraries/AP_BoardConfig/IMU_heater.cpp index ca2dbecc33..221aa5c987 100644 --- a/libraries/AP_BoardConfig/IMU_heater.cpp +++ b/libraries/AP_BoardConfig/IMU_heater.cpp @@ -35,7 +35,10 @@ void AP_BoardConfig::set_imu_temp(float current) hal.util->set_imu_temp(current); if (target == -1) { - // nothing to do + // nothing to do, make sure heater is left off +#if defined(HAL_HEATER_GPIO_PIN) + hal.gpio->write(HAL_HEATER_GPIO_PIN, false); +#endif return; }