mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-17 10:30:34 +08:00
param: Add contained-params-bitset export interface to the param layers
Allows for efficient looping over the contained data
This commit is contained in:
committed by
Beat Küng
parent
bc872822bc
commit
f0dd9fa445
@@ -1039,6 +1039,7 @@ param_export(const char *filename, param_filter_func filter)
|
||||
static int param_export_internal(int fd, param_filter_func filter)
|
||||
{
|
||||
PX4_DEBUG("param_export_internal");
|
||||
const auto changed_params = user_config.containedAsBitset();
|
||||
|
||||
int result = -1;
|
||||
bson_encoder_s encoder{};
|
||||
@@ -1054,7 +1055,7 @@ static int param_export_internal(int fd, param_filter_func filter)
|
||||
}
|
||||
|
||||
for (param_t param = 0; handle_in_range(param); param++) {
|
||||
if (filter && !filter(param)) {
|
||||
if (!changed_params[param] || (filter && !filter(param))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user