px4_parameters.hpp.jinja 1.25 KB
{# 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