mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 23:33:38 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user