File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -224,6 +224,14 @@ namespace WX_Utils {
224224        }
225225    }
226226
227+     float  getAltitudeCorrection () {
228+         #ifdef  HAS_GPS
229+             return  Config.beacon .gpsActive  ? gps.altitude .meters () : Config.wxsensor .heightCorrection ;
230+         #else 
231+             return  Config.wxsensor .heightCorrection ;
232+         #endif 
233+     }
234+ 
227235    String readDataSensor () {
228236        switch  (wxModuleType) {
229237            case  1 : //  BME280
@@ -282,11 +290,7 @@ namespace WX_Utils {
282290
283291            String presStr = (wxModuleType == 4  || wxModuleType == 5 ) 
284292                ? " ....." 
285-             #ifdef  HAS_GPS
286-                 : generatePresString (newPress + (gps.altitude .meters () / CORRECTION_FACTOR));
287-             #else 
288-                 : generatePresString (newPress + (Config.wxsensor .heightCorrection  / CORRECTION_FACTOR));
289-             #endif 
293+                 : generatePresString (newPress + getAltitudeCorrection () / CORRECTION_FACTOR);
290294
291295            fifthLine = " BME-> " 
292296            fifthLine += String (int (newTemp + Config.wxsensor .temperatureCorrection ));
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments