From 6e3be132f28c7601f5b9869d6917b2dec775ff75 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sun, 16 Nov 2025 14:20:17 -0600 Subject: [PATCH] Reset the calibration data back to 0 when doing a compass calibration --- src/motion/BMX160Sensor.cpp | 3 ++- src/motion/ICM20948Sensor.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/motion/BMX160Sensor.cpp b/src/motion/BMX160Sensor.cpp index 003ee850c..56f794306 100755 --- a/src/motion/BMX160Sensor.cpp +++ b/src/motion/BMX160Sensor.cpp @@ -116,6 +116,7 @@ void BMX160Sensor::calibrate(uint16_t forSeconds) { #if !defined(MESHTASTIC_EXCLUDE_SCREEN) LOG_DEBUG("BMX160 calibration started for %is", forSeconds); + highestX = 0, lowestX = 0, highestY = 0, lowestY = 0, highestZ = 0, lowestZ = 0; doCalibration = true; uint16_t calibrateFor = forSeconds * 1000; // calibrate for seconds provided @@ -127,4 +128,4 @@ void BMX160Sensor::calibrate(uint16_t forSeconds) #endif -#endif \ No newline at end of file +#endif diff --git a/src/motion/ICM20948Sensor.cpp b/src/motion/ICM20948Sensor.cpp index 76ba8e8cf..ebb0f7b66 100755 --- a/src/motion/ICM20948Sensor.cpp +++ b/src/motion/ICM20948Sensor.cpp @@ -157,6 +157,7 @@ void ICM20948Sensor::calibrate(uint16_t forSeconds) { #if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN LOG_DEBUG("BMX160 calibration started for %is", forSeconds); + highestX = 0, lowestX = 0, highestY = 0, lowestY = 0, highestZ = 0, lowestZ = 0; doCalibration = true; uint16_t calibrateFor = forSeconds * 1000; // calibrate for seconds provided @@ -295,4 +296,4 @@ bool ICM20948Singleton::setWakeOnMotion() return true; } -#endif \ No newline at end of file +#endif