From 6cbe8173e82c703e3518340a206901f64e299d2e Mon Sep 17 00:00:00 2001 From: richonguzman Date: Wed, 30 Jul 2025 08:53:02 -0400 Subject: [PATCH] test1 --- src/wx_utils.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/wx_utils.cpp b/src/wx_utils.cpp index 149efcc..7268bce 100644 --- a/src/wx_utils.cpp +++ b/src/wx_utils.cpp @@ -224,6 +224,14 @@ namespace WX_Utils { } } + float getAltitudeCorrection() { + #ifdef HAS_GPS + return Config.beacon.gpsActive ? gps.altitude.meters() : Config.wxsensor.heightCorrection; + #else + return Config.wxsensor.heightCorrection; + #endif + } + String readDataSensor() { switch (wxModuleType) { case 1: // BME280 @@ -282,11 +290,7 @@ namespace WX_Utils { String presStr = (wxModuleType == 4 || wxModuleType == 5) ? "....." - #ifdef HAS_GPS - : generatePresString(newPress + (gps.altitude.meters() / CORRECTION_FACTOR)); - #else - : generatePresString(newPress + (Config.wxsensor.heightCorrection / CORRECTION_FACTOR)); - #endif + : generatePresString(newPress + getAltitudeCorrection() / CORRECTION_FACTOR); fifthLine = "BME-> "; fifthLine += String(int(newTemp + Config.wxsensor.temperatureCorrection));