Skip to content

Commit

Permalink
Rover: move parameter storage formatting up to AP_Vehicle
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Feb 13, 2024
1 parent 469e473 commit 30c8a17
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions Rover/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,22 +811,8 @@ const AP_Param::ConversionInfo conversion_table[] = {

void Rover::load_parameters(void)
{
if (!g.format_version.load() ||
g.format_version != Parameters::k_format_version) {
// erase all parameters
hal.console->printf("Firmware change: erasing EEPROM...\n");
StorageManager::erase();
AP_Param::erase_all();

// save the current format version
g.format_version.set_and_save(Parameters::k_format_version);
hal.console->printf("done.\n");
}
g.format_version.set_default(Parameters::k_format_version);
AP_Vehicle::load_parameters(g.format_version, Parameters::k_format_version);

const uint32_t before = micros();
// Load all auto-loaded EEPROM variables
AP_Param::load_all();
AP_Param::convert_old_parameters(&conversion_table[0], ARRAY_SIZE(conversion_table));

AP_Param::set_frame_type_flags(AP_PARAM_FRAME_ROVER);
Expand All @@ -839,7 +825,6 @@ void Rover::load_parameters(void)
}

SRV_Channels::upgrade_parameters();
hal.console->printf("load_all took %uus\n", unsigned(micros() - before));

// convert CH7_OPTION to RC7_OPTION for Rover-3.4 to 3.5 upgrade
const AP_Param::ConversionInfo ch7_option_info = { Parameters::k_param_ch7_option, 0, AP_PARAM_INT8, "RC7_OPTION" };
Expand Down

0 comments on commit 30c8a17

Please sign in to comment.