From b3d025a0b983d4b907d5bf81198e172e82e7463f Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Mon, 5 May 2025 21:49:30 -0500 Subject: [PATCH] Check for HAS_SCREEN for showing calibration screen --- src/ButtonThread.cpp | 2 +- src/motion/ICM20948Sensor.cpp | 4 ++-- src/motion/MotionSensor.cpp | 2 +- src/motion/MotionSensor.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ButtonThread.cpp b/src/ButtonThread.cpp index c3fdf2b41..352885dbe 100644 --- a/src/ButtonThread.cpp +++ b/src/ButtonThread.cpp @@ -255,7 +255,7 @@ int32_t ButtonThread::runOnce() digitalWrite(PIN_EINK_EN, digitalRead(PIN_EINK_EN) == LOW); break; #endif -#if !MESHTASTIC_EXCLUDE_SCREEN +#if !MESHTASTIC_EXCLUDE_SCREEN && HAS_SCREEN // 5 clicks: start accelerometer/magenetometer calibration for 30 seconds case 5: if (accelerometerThread) { diff --git a/src/motion/ICM20948Sensor.cpp b/src/motion/ICM20948Sensor.cpp index dd0d5efba..d03633124 100755 --- a/src/motion/ICM20948Sensor.cpp +++ b/src/motion/ICM20948Sensor.cpp @@ -46,7 +46,7 @@ int32_t ICM20948Sensor::runOnce() int32_t ICM20948Sensor::runOnce() { -#if !defined(MESHTASTIC_EXCLUDE_SCREEN) +#if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN float magX = 0, magY = 0, magZ = 0; if (sensor->dataReady()) { sensor->getAGMT(); @@ -153,7 +153,7 @@ int32_t ICM20948Sensor::runOnce() void ICM20948Sensor::calibrate(uint16_t forSeconds) { -#if !defined(MESHTASTIC_EXCLUDE_SCREEN) +#if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN LOG_DEBUG("BMX160 calibration started for %is", forSeconds); doCalibration = true; diff --git a/src/motion/MotionSensor.cpp b/src/motion/MotionSensor.cpp index a6718c8d5..56738d355 100755 --- a/src/motion/MotionSensor.cpp +++ b/src/motion/MotionSensor.cpp @@ -31,7 +31,7 @@ ScanI2C::I2CPort MotionSensor::devicePort() return device.address.port; } -#if !MESHTASTIC_EXCLUDE_SCREEN +#if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN void MotionSensor::drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y) { // int x_offset = display->width() / 2; diff --git a/src/motion/MotionSensor.h b/src/motion/MotionSensor.h index df864fc9c..5039f2551 100755 --- a/src/motion/MotionSensor.h +++ b/src/motion/MotionSensor.h @@ -49,7 +49,7 @@ class MotionSensor // Register a button press when a double-tap is detected virtual void buttonPress(); -#if !MESHTASTIC_EXCLUDE_SCREEN +#if !defined(MESHTASTIC_EXCLUDE_SCREEN) && HAS_SCREEN // draw an OLED frame (currently only used by the RAK4631 BMX160 sensor) static void drawFrameCalibration(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y); #endif