fix param import transition

* fix param import transition for MC_DTERM_CUTOFF

The previous implementation did not work, as there was a check for
param_find_no_notification() returning PARAM_INVALID for IMU_DGYRO_CUTOFF,
and therefore would not call param_modify_on_import().

This moves param_modify_on_import() before the check and makes it modify
the bson node directly.

* parameters: fix param import transition when testing is enabled

BUILD_TESTING is used for unit test builds, PX4_TESTING is used to enable additional test material within PX4

Co-authored-by: Daniel Agar <daniel@agar.ca>
This commit is contained in:
Beat Küng
2020-04-02 18:41:00 -04:00
committed by GitHub
co-authored by Daniel Agar
parent 2baa5ca4d7
commit dfb5b5d7d9
6 changed files with 17 additions and 25 deletions
@@ -229,6 +229,8 @@ param_import_callback(bson_decoder_t decoder, void *priv, bson_node_t node)
return 0;
}
param_modify_on_import(node);
/*
* Find the parameter this node represents. If we don't know it,
* ignore the node.
@@ -301,8 +303,6 @@ 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_external(param, v, state->mark_saved, true)) {
debug("error setting value for '%s'", node->name);