- make the selected parameter a template argument. This
enables type-checking at compile-time.
- move things to src/platforms.
This provides consistent includes with ModuleBase
- add ModuleParams base class (replaces Block & SuperBlock)
- drop the Block* prefix from the class names
Generates an enum with all params & additional type information for static
type checking
The generated public param header is required to build the modules using
the new BlockParam classes.
In rare circumstances, the buffer size was too small by 1 byte, leading
to a param export failure. And leading to a reset of all params!
This could only happen when the last saved param was a float.
Also the realloc_ok initialization is not needed.
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)
Volatile parameters are ones that do not represent a fundamental configuration change but rather than incrementally changing settings. These include logged flight hours or sensor offsets. Marking them as volatile avoids these parameters forcing time-consuming telemetry updates.
This helps subscribers to understand if they should update their parameters or not. We will extend this with other flags such as the current save status and alike.
param save is an expensive operation that can take several 100ms. And
previously it was possible that a param_get() caller was blocked on a
save operation. If this happened due to a param change notification,
important modules, such as sensors, could have been blocked for a longer
period (and affecting the flight performance).
With this patch, this situation is not possible anymore, because a param
save now uses the reader lock and a separate file lock.
However it is still possible that a param_set() needs to wait for a save
operation, thus blocking for a longer time. param_set() thus needs to be
avoided in important modules when the system is armed.
In the case of mavlink it works, since it does not affect the flight if
the mavlink receiver is blocked over a longer time. It is only problematic
if a joystick is used as input or in offboard control.
This can happen for example when a param type is changed from int32 to
float. The type check will then fail if the param is stored and the param
import will be aborted.
Now we just skip the entry and continue loading the rest.
The ramtron driver already calls SPI_LOCK when accessing the
FRAM.
Removed the interrupt lockout and anabled the SPI_LOCK
in the ms5611 driver on any HW where the
PX4_SPI_BUS_BARO == PX4_SPI_BUS_RAMTRON