px4_parameters.hpp.jinja
1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{# jinja syntax: http://jinja.pocoo.org/docs/2.9/templates/ #}
#include <stdint.h>
#include <parameters/param.h>
// DO NOT EDIT
// This file is autogenerated from parameters.xml
namespace px4 { {# wrap the enum in a namespace, otherwise we get shadowing errors for MAV_TYPE #}
/// Enum with all parameters
enum class params : uint16_t {
{# enums are guaranteed to start with 0 (if the value for the first is not
specified), and then incremented by 1 (the implementation depends on that!) #}
{%- for param in params %}
{{ param.attrib["name"] }},
{%- endfor %}
};
static constexpr param_info_s parameters[] = {
{% for param in params %}
{
"{{ param.attrib["name"] }}",
{%- if param.attrib["type"] == "FLOAT" %}
.val = {{ "{" }} .f = {{ param.attrib["default"] }} {{ "}" }},
{%- elif param.attrib["type"] == "INT32" %}
.val = {{ "{" }} .i = {{ param.attrib["default"] }}{{ "}" }},
{%- endif %}
},
{% endfor %}
};
static constexpr param_type_t parameters_type[] = {
{% for param in params %}
PARAM_TYPE_{{ param.attrib["type"] }},
{%- endfor -%}
};
static constexpr params parameters_volatile[] = {
{% for param in params %}
{%- if param.attrib["volatile"] == "true" %}
params::{{ param.attrib["name"] }},
{%- endif -%}
{% endfor %}
};
} // namespace px4