From 2f7e47914504a6aa21317410e9a6b4caff7e8a64 Mon Sep 17 00:00:00 2001 From: Dan Welch Date: Thu, 12 Dec 2024 14:22:53 -0700 Subject: [PATCH] Fix build on RAK4631_eth_gw - exclude all compass heading updates on variant without screen --- src/motion/BMX160Sensor.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/motion/BMX160Sensor.cpp b/src/motion/BMX160Sensor.cpp index 69485cedd4..06cea32297 100755 --- a/src/motion/BMX160Sensor.cpp +++ b/src/motion/BMX160Sensor.cpp @@ -25,6 +25,7 @@ bool BMX160Sensor::init() int32_t BMX160Sensor::runOnce() { +#if !defined(MESHTASTIC_EXCLUDE_SCREEN) sBmx160SensorData_t magAccel; sBmx160SensorData_t gAccel; @@ -33,13 +34,11 @@ 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; @@ -66,7 +65,6 @@ int32_t BMX160Sensor::runOnce() // lowestY, highestY, lowestZ, highestZ); } -#if !defined(MESHTASTIC_EXCLUDE_SCREEN) int highestRealX = highestX - (highestX + lowestX) / 2; magAccel.x -= (highestX + lowestX) / 2; @@ -114,13 +112,12 @@ int32_t BMX160Sensor::runOnce() void BMX160Sensor::calibrate(uint16_t forSeconds) { - +#if !defined(MESHTASTIC_EXCLUDE_SCREEN) LOG_DEBUG("BMX160 calibration started for %is", forSeconds); doCalibration = true; uint16_t calibrateFor = forSeconds * 1000; // calibrate for seconds provided endCalibrationAt = millis() + calibrateFor; -#if !defined(MESHTASTIC_EXCLUDE_SCREEN) screen->setEndCalibration(endCalibrationAt); #endif }