param: automatically update calibration ID params on import

This avoids the need for recalibration, and also cleans up other driver
ID's (merge separate accel/gyro).

The SPI address was previously set to a board-specific (arbitrary) value,
and is now set to 0. This will allow extending for multiple sensors of the
same type on the same bus.
This commit is contained in:
Beat Küng
2020-02-22 10:49:14 +01:00
committed by Daniel Agar
parent 1851665fab
commit b54e5a1c23
29 changed files with 275 additions and 65 deletions
+3
View File
@@ -42,6 +42,7 @@
*/
#include "param.h"
#include "param_translation.h"
#include <parameters/px4_parameters.h>
#include "tinybson/tinybson.h"
@@ -1261,6 +1262,8 @@ param_import_callback(bson_decoder_t decoder, void *priv, bson_node_t node)
goto out;
}
param_modify_on_import(node->name, node->type, v);
if (param_set_internal(param, v, state->mark_saved, true)) {
PX4_DEBUG("error setting value for '%s'", node->name);
goto out;