mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 09:22:18 +00:00
Params: Remove linker black magic and turn params into flat global struct
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user