mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
param_export: reduce bson buffer size from 512 to 256
Some modules call this (and maybe in rare circumstances), which could lead to stack overflows. With our current headroom of >= 300bytes, 256 should be ok. This increases the export time from ~28ms to ~34ms in my case (on a Pixracer)
This commit is contained in:
parent
ee9853a3d6
commit
f962e9826b
@ -1048,7 +1048,7 @@ param_export(int fd, bool only_unsaved)
|
||||
|
||||
param_lock_reader();
|
||||
|
||||
uint8_t bson_buffer[512];
|
||||
uint8_t bson_buffer[256];
|
||||
bson_encoder_init_buf(&encoder, &bson_buffer, sizeof(bson_buffer));
|
||||
|
||||
/* no modified parameters -> we are done */
|
||||
|
||||
@ -299,6 +299,7 @@ __EXPORT void param_reset_excludes(const char *excludes[], int num_excludes);
|
||||
|
||||
/**
|
||||
* Export changed parameters to a file.
|
||||
* Note: this method requires a large amount of stack size!
|
||||
*
|
||||
* @param fd File descriptor to export to.
|
||||
* @param only_unsaved Only export changed parameters that have not yet been exported.
|
||||
@ -365,6 +366,7 @@ __EXPORT const char *param_get_default_file(void);
|
||||
|
||||
/**
|
||||
* Save parameters to the default file.
|
||||
* Note: this method requires a large amount of stack size!
|
||||
*
|
||||
* This function saves all parameters with non-default values.
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user