This commit is contained in:
richonguzman 2025-07-30 08:53:02 -04:00
parent b4261f37cb
commit 6cbe8173e8

View file

@ -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));