mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-29 07:30:34 +08:00
move param jinja templates into relevant module
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
{# jinja syntax: http://jinja.pocoo.org/docs/2.9/templates/ #}
|
||||
#include <px4_parameters.h>
|
||||
|
||||
// DO NOT EDIT
|
||||
// This file is autogenerated from paramaters.xml
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
const
|
||||
#ifndef __PX4_DARWIN
|
||||
__attribute__((used, section("__param")))
|
||||
#endif
|
||||
|
||||
struct px4_parameters_t px4_parameters = {
|
||||
{% for param in params %}
|
||||
{
|
||||
"{{ param.attrib["name"] }}",
|
||||
PARAM_TYPE_{{ param.attrib["type"] }},
|
||||
{%- if param.attrib["type"] == "FLOAT" %}
|
||||
.val.f = {{ param.attrib["default"] }}
|
||||
{%- elif param.attrib["type"] == "INT32" %}
|
||||
.val.i = {{ param.attrib["default"] }}
|
||||
{%- endif %}
|
||||
},
|
||||
{% endfor %}
|
||||
{{ params | length }}
|
||||
};
|
||||
|
||||
//extern const struct px4_parameters_t px4_parameters;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
{# vim: set noet ft=jinja fenc=utf-8 ff=unix sts=4 sw=4 ts=4 : #}
|
||||
@@ -0,0 +1,21 @@
|
||||
{# jinja syntax: http://jinja.pocoo.org/docs/2.9/templates/ #}
|
||||
#include <stdint.h>
|
||||
#include <systemlib/param/param.h>
|
||||
|
||||
// DO NOT EDIT
|
||||
// This file is autogenerated from parameters.xml
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
struct px4_parameters_t {
|
||||
{%- for param in params %}
|
||||
const struct param_info_s __param__{{ param.attrib["name"] }};
|
||||
{%- endfor %}
|
||||
const unsigned int param_count;
|
||||
};
|
||||
|
||||
extern const struct px4_parameters_t px4_parameters;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
{# vim: set noet ft=jinja fenc=utf-8 ff=unix sts=4 sw=4 ts=4 : #}
|
||||
Reference in New Issue
Block a user