mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 22:53:33 +08:00
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:
@@ -57,6 +57,7 @@
|
||||
#include <parameters/tinybson/tinybson.h>
|
||||
#include "flashparams.h"
|
||||
#include "flashfs.h"
|
||||
#include "../param_translation.h"
|
||||
|
||||
#if 0
|
||||
# define debug(fmt, args...) do { warnx(fmt, ##args); } while(0)
|
||||
@@ -300,6 +301,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_external(param, v, state->mark_saved, true)) {
|
||||
|
||||
debug("error setting value for '%s'", node->name);
|
||||
|
||||
Reference in New Issue
Block a user