mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-23 14:27:35 +08:00
parameters: merge generated files ito single static constexpr header
- store parameter type and if volatile separately (saves kilobytes of flash)
- use Bitset for tracking active and changed parameters
- use atomic for autosave_enabled flag
- compile at ${MAX_CUSTOM_OPT_LEVEL} (-O2 on non flash constrained boards)
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
|
||||
#include "param_macros.h"
|
||||
|
||||
#include <parameters/px4_parameters_public.h>
|
||||
#include <parameters/px4_parameters.hpp>
|
||||
|
||||
/**
|
||||
* get the parameter handle from a parameter enum
|
||||
@@ -112,7 +112,7 @@ class Param<float, p>
|
||||
{
|
||||
public:
|
||||
// static type-check
|
||||
static_assert(px4::param_types_array[(int)p] == PARAM_TYPE_FLOAT, "parameter type must be float");
|
||||
static_assert(px4::parameters_type[(int)p] == PARAM_TYPE_FLOAT, "parameter type must be float");
|
||||
|
||||
Param()
|
||||
{
|
||||
@@ -151,7 +151,7 @@ class Param<float &, p>
|
||||
{
|
||||
public:
|
||||
// static type-check
|
||||
static_assert(px4::param_types_array[(int)p] == PARAM_TYPE_FLOAT, "parameter type must be float");
|
||||
static_assert(px4::parameters_type[(int)p] == PARAM_TYPE_FLOAT, "parameter type must be float");
|
||||
|
||||
Param(float &external_val)
|
||||
: _val(external_val)
|
||||
@@ -190,7 +190,7 @@ class Param<int32_t, p>
|
||||
{
|
||||
public:
|
||||
// static type-check
|
||||
static_assert(px4::param_types_array[(int)p] == PARAM_TYPE_INT32, "parameter type must be int32_t");
|
||||
static_assert(px4::parameters_type[(int)p] == PARAM_TYPE_INT32, "parameter type must be int32_t");
|
||||
|
||||
Param()
|
||||
{
|
||||
@@ -229,7 +229,7 @@ class Param<int32_t &, p>
|
||||
{
|
||||
public:
|
||||
// static type-check
|
||||
static_assert(px4::param_types_array[(int)p] == PARAM_TYPE_INT32, "parameter type must be int32_t");
|
||||
static_assert(px4::parameters_type[(int)p] == PARAM_TYPE_INT32, "parameter type must be int32_t");
|
||||
|
||||
Param(int32_t &external_val)
|
||||
: _val(external_val)
|
||||
@@ -268,7 +268,7 @@ class Param<bool, p>
|
||||
{
|
||||
public:
|
||||
// static type-check
|
||||
static_assert(px4::param_types_array[(int)p] == PARAM_TYPE_INT32, "parameter type must be int32_t");
|
||||
static_assert(px4::parameters_type[(int)p] == PARAM_TYPE_INT32, "parameter type must be int32_t");
|
||||
|
||||
Param()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user