LCOV - code coverage report
Current view: top level - AP_Vehicle - Parameters.cpp (source / functions) Hit Total Coverage
Test: lcov.info Lines: 11 11 100.0 %
Date: 2026-09-09 11:02:08 Functions: 1 1 100.0 %

          Line data    Source code
       1             : #include "AP_Vehicle.h"
       2             : 
       3             : #if AP_VEHICLE_ENABLED
       4             : 
       5             : #include <AP_Param/AP_Param.h>
       6             : #include <StorageManager/StorageManager.h>
       7             : 
       8        2094 : void AP_Vehicle::load_parameters(AP_Int16 &format_version, const uint16_t expected_format_version)
       9             : {
      10        3893 :     if (!format_version.load() ||
      11        1799 :         format_version != expected_format_version) {
      12             : 
      13             :         // erase all parameters
      14         295 :         hal.console->printf("Firmware change: erasing EEPROM...\n");
      15         295 :         StorageManager::erase();
      16         295 :         AP_Param::erase_all();
      17             : 
      18             :         // save the current format version
      19         295 :         format_version.set_and_save(expected_format_version);
      20         295 :         hal.console->printf("done.\n");
      21             :     }
      22        2094 :     format_version.set_default(expected_format_version);
      23             : 
      24             :     // Load all auto-loaded EEPROM variables
      25        2094 :     AP_Param::load_all();
      26        2094 : }
      27             : 
      28             : #endif  // AP_VEHICLE_ENABLED

Generated by: LCOV version 1.14