LCOV - code coverage report
Current view: top level - home/pbarker/rc/ardupilot/ArduSub - terrain.cpp (source / functions) Hit Total Coverage
Test: lcov.info Lines: 8 9 88.9 %
Date: 2026-09-09 11:02:08 Functions: 2 2 100.0 %

          Line data    Source code
       1             : #include "Sub.h"
       2             : 
       3             : // update terrain data
       4       54479 : void Sub::terrain_update()
       5             : {
       6             : #if AP_TERRAIN_AVAILABLE
       7       54479 :     terrain.update();
       8             : 
       9             :     // tell the rangefinder our height, so it can go into power saving
      10             :     // mode if available
      11             : #if AP_RANGEFINDER_ENABLED
      12             :     float height;
      13       54479 :     if (terrain.height_above_terrain(height, true)) {
      14           0 :         rangefinder.set_estimated_terrain_height(height);
      15             :     }
      16             : #endif
      17             : #endif
      18       54479 : }
      19             : 
      20             : #if HAL_LOGGING_ENABLED
      21             : // log terrain data - should be called at 1hz
      22        5409 : void Sub::terrain_logging()
      23             : {
      24             : #if AP_TERRAIN_AVAILABLE
      25        5409 :     if (should_log(MASK_LOG_GPS)) {
      26        5198 :         terrain.log_terrain_data();
      27             :     }
      28             : #endif
      29        5409 : }
      30             : #endif  // HAL_LOGGING_ENABLED
      31             : 

Generated by: LCOV version 1.14