AP_RangeFinder: invalidate param count when changing param tree structure

This commit is contained in:
Andrew Tridgell 2020-04-19 09:01:25 +10:00
parent d7555b4b86
commit ffe9fa22a1

View File

@ -510,6 +510,9 @@ void RangeFinder::detect_instance(uint8_t instance, uint8_t& serial_instance)
if (drivers[instance] && state[instance].var_info) { if (drivers[instance] && state[instance].var_info) {
backend_var_info[instance] = state[instance].var_info; backend_var_info[instance] = state[instance].var_info;
AP_Param::load_object_from_eeprom(drivers[instance], backend_var_info[instance]); AP_Param::load_object_from_eeprom(drivers[instance], backend_var_info[instance]);
// param count could have changed
AP_Param::invalidate_count();
} }
} }