AP_BoardConfig: add static create method
This commit is contained in:
parent
a74e700006
commit
ef3edc531c
@ -9,11 +9,13 @@ extern "C" typedef int (*main_fn_t)(int argc, char **);
|
||||
|
||||
class AP_BoardConfig {
|
||||
public:
|
||||
// constructor
|
||||
AP_BoardConfig(void)
|
||||
{
|
||||
AP_Param::setup_object_defaults(this, var_info);
|
||||
};
|
||||
static AP_BoardConfig create() { return AP_BoardConfig{}; }
|
||||
|
||||
constexpr AP_BoardConfig(AP_BoardConfig &&other) = default;
|
||||
|
||||
/* Do not allow copies */
|
||||
AP_BoardConfig(const AP_BoardConfig &other) = delete;
|
||||
AP_BoardConfig &operator=(const AP_BoardConfig&) = delete;
|
||||
|
||||
void init(void);
|
||||
void init_safety(void);
|
||||
@ -68,6 +70,10 @@ public:
|
||||
#endif
|
||||
|
||||
private:
|
||||
AP_BoardConfig() {
|
||||
AP_Param::setup_object_defaults(this, var_info);
|
||||
};
|
||||
|
||||
AP_Int16 vehicleSerialNumber;
|
||||
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
|
||||
|
@ -11,11 +11,13 @@
|
||||
|
||||
class AP_BoardConfig_CAN {
|
||||
public:
|
||||
// constructor
|
||||
AP_BoardConfig_CAN(void)
|
||||
{
|
||||
AP_Param::setup_object_defaults(this, var_info);
|
||||
};
|
||||
static AP_BoardConfig_CAN create() { return AP_BoardConfig_CAN{}; }
|
||||
|
||||
constexpr AP_BoardConfig_CAN(AP_BoardConfig_CAN &&other) = default;
|
||||
|
||||
/* Do not allow copies */
|
||||
AP_BoardConfig_CAN(const AP_BoardConfig_CAN &other) = delete;
|
||||
AP_BoardConfig_CAN &operator=(const AP_BoardConfig_CAN&) = delete;
|
||||
|
||||
void init(void);
|
||||
|
||||
@ -96,5 +98,10 @@ public:
|
||||
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 || CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
|
||||
void px4_setup_canbus(void);
|
||||
#endif // HAL_BOARD_PX4 || HAL_BOARD_VRBRAIN
|
||||
|
||||
private:
|
||||
AP_BoardConfig_CAN() {
|
||||
AP_Param::setup_object_defaults(this, var_info);
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user