Blimp: move parameter storage formatting up to AP_Vehicle
This commit is contained in:
parent
df72d3faac
commit
ea7788f49d
@ -840,25 +840,7 @@ ParametersG2::ParametersG2(void)
|
|||||||
|
|
||||||
void Blimp::load_parameters(void)
|
void Blimp::load_parameters(void)
|
||||||
{
|
{
|
||||||
hal.util->set_soft_armed(false);
|
AP_Vehicle::load_parameters(g.format_version, Parameters::k_format_version);
|
||||||
|
|
||||||
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);
|
|
||||||
|
|
||||||
uint32_t before = micros();
|
|
||||||
// Load all auto-loaded EEPROM variables
|
|
||||||
AP_Param::load_all();
|
|
||||||
|
|
||||||
// PARAMETER_CONVERSION - Added: Jan-2024 for Copter-4.6
|
// PARAMETER_CONVERSION - Added: Jan-2024 for Copter-4.6
|
||||||
#if AP_STATS_ENABLED
|
#if AP_STATS_ENABLED
|
||||||
@ -894,8 +876,6 @@ void Blimp::load_parameters(void)
|
|||||||
AP_Param::convert_class(g.k_param_logger, &logger, logger.var_info, 0, 0, true);
|
AP_Param::convert_class(g.k_param_logger, &logger, logger.var_info, 0, 0, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
hal.console->printf("load_all took %uus\n", (unsigned)(micros() - before));
|
|
||||||
|
|
||||||
// setup AP_Param frame type flags
|
// setup AP_Param frame type flags
|
||||||
AP_Param::set_frame_type_flags(AP_PARAM_FRAME_BLIMP);
|
AP_Param::set_frame_type_flags(AP_PARAM_FRAME_BLIMP);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user