Params: Remove linker black magic and turn params into flat global struct

This commit is contained in:
Lorenz Meier
2015-09-12 11:26:20 +02:00
parent 4bc44841f6
commit c5d1cb1cbc

View File

@@ -19,7 +19,9 @@ header = """
#include <systemlib/param/param.h>
// DO NOT EDIT
// This file is autogenerated from paramaters.xml
// This file is autogenerated from parameters.xml
__BEGIN_DECLS
struct px4_parameters_t {
"""
@@ -52,11 +54,11 @@ src = """
// DO NOT EDIT
// This file is autogenerated from paramaters.xml
static const
const
#ifndef __PX4_DARWIN
__attribute__((used, section("__param")))
#endif
struct px4_parameters_t px4_parameters_impl = {
struct px4_parameters_t px4_parameters = {
"""
i=0
for group in root:
@@ -81,13 +83,10 @@ src += """
%d
};
#ifdef __PX4_DARWIN
#define ___param__attributes
#else
#define ___param__attributes __attribute__((alias("px4_parameters_impl")))
#endif
//extern const struct px4_parameters_t px4_parameters;
__END_DECLS
extern const struct px4_parameters_t px4_parameters ___param__attributes;
""" % i
fp_header.write(header)