From ffe9fa22a1471fdfc929c683524e3854b27da1f1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 19 Apr 2020 09:01:25 +1000 Subject: [PATCH] AP_RangeFinder: invalidate param count when changing param tree structure --- libraries/AP_RangeFinder/AP_RangeFinder.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/AP_RangeFinder/AP_RangeFinder.cpp b/libraries/AP_RangeFinder/AP_RangeFinder.cpp index 7daf3c065c..e883cf17a5 100644 --- a/libraries/AP_RangeFinder/AP_RangeFinder.cpp +++ b/libraries/AP_RangeFinder/AP_RangeFinder.cpp @@ -510,6 +510,9 @@ void RangeFinder::detect_instance(uint8_t instance, uint8_t& serial_instance) if (drivers[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]); + + // param count could have changed + AP_Param::invalidate_count(); } }