diff --git a/src/ButtonThread.cpp b/src/ButtonThread.cpp index 664c3560f8..5175a26809 100644 --- a/src/ButtonThread.cpp +++ b/src/ButtonThread.cpp @@ -191,6 +191,7 @@ int32_t ButtonThread::runOnce() digitalWrite(PIN_EINK_EN, digitalRead(PIN_EINK_EN) == LOW); break; #endif +#if defined(RAK_4631) // 5 clicks: start accelerometer/magenetometer calibration for 30 seconds case 5: if (accelerometerThread) { @@ -203,6 +204,7 @@ int32_t ButtonThread::runOnce() accelerometerThread->calibrate(60); } break; +#endif // No valid multipress action default: break; diff --git a/src/motion/BMX160Sensor.cpp b/src/motion/BMX160Sensor.cpp index 8e483fc532..69485cedd4 100755 --- a/src/motion/BMX160Sensor.cpp +++ b/src/motion/BMX160Sensor.cpp @@ -33,11 +33,13 @@ int32_t BMX160Sensor::runOnce() if (doCalibration) { +#if !defined(MESHTASTIC_EXCLUDE_SCREEN) if (!showingScreen) { powerFSM.trigger(EVENT_PRESS); // keep screen alive during calibration showingScreen = true; screen->startAlert((FrameCallback)drawFrameCalibration); } +#endif if (magAccel.x > highestX) highestX = magAccel.x; @@ -103,6 +105,7 @@ int32_t BMX160Sensor::runOnce() heading += 270; break; } + screen->setHeading(heading); #endif @@ -117,7 +120,9 @@ void BMX160Sensor::calibrate(uint16_t forSeconds) doCalibration = true; uint16_t calibrateFor = forSeconds * 1000; // calibrate for seconds provided endCalibrationAt = millis() + calibrateFor; +#if !defined(MESHTASTIC_EXCLUDE_SCREEN) screen->setEndCalibration(endCalibrationAt); +#endif } #endif diff --git a/src/motion/MotionSensor.h b/src/motion/MotionSensor.h index 1848c472a1..1f4d093bfc 100755 --- a/src/motion/MotionSensor.h +++ b/src/motion/MotionSensor.h @@ -58,7 +58,7 @@ class MotionSensor // Do calibration if true bool doCalibration = false; - uint32_t endCalibrationAt; + uint32_t endCalibrationAt = 0; }; namespace MotionSensorI2C