fix(param): use C-style array for parameters_volatile/readonly

NuttX builds do not provide the C++17 <array> header, so the generated
px4_parameters.hpp failed to compile on every NuttX board (px4_fmu-v5,
nxp_fmuk66-v3, modalai voxl2 SLPI, etc.) with:

    fatal error: array: No such file or directory

Drop std::array in favour of plain C arrays, which range-based for
already supports and which the embedded toolchains can compile. The
length is no longer needed in the type because the generator now
pre-filters volatile_params and readonly_param_names, and an empty
array would have been ill-formed under either spelling.

Signed-off-by: Nuno Marques <n.marques21@hotmail.com>
This commit is contained in:
Nuno Marques
2026-05-07 16:51:38 -07:00
parent 99a7cc292d
commit 2f167b9d57
@@ -2,7 +2,6 @@
#include <math.h> // NAN
#include <array>
#include <stdint.h>
#include <parameters/param.h>
@@ -39,13 +38,13 @@ static constexpr param_type_t parameters_type[] = {
{%- endfor -%}
};
static constexpr std::array<params, {{ volatile_params | length }}> parameters_volatile {
static constexpr params parameters_volatile[] = {
{% for param in volatile_params %}
params::{{ param.attrib["name"] }},
{% endfor %}
};
static constexpr std::array<params, {{ readonly_param_names | length }}> parameters_readonly {
static constexpr params parameters_readonly[] = {
{% for param_name in readonly_param_names %}
params::{{ param_name }},
{% endfor %}