mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-26 17:16:36 +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
@@ -84,16 +84,17 @@ param_export_internal(param_filter_func filter)
|
||||
/* Use realloc */
|
||||
|
||||
bson_encoder_init_buf(&encoder, nullptr, 0);
|
||||
auto changed_params = user_config.containedAsBitset();
|
||||
|
||||
for (param_t param = 0; param < user_config.PARAM_COUNT; param++) {
|
||||
|
||||
int32_t i;
|
||||
float f;
|
||||
|
||||
if (filter && !filter(param)) {
|
||||
if (!changed_params[param] || (filter && !filter(param))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int32_t i;
|
||||
float f;
|
||||
|
||||
/* append the appropriate BSON type object */
|
||||
|
||||
switch (param_type(param)) {
|
||||
|
||||
Reference in New Issue
Block a user