From b6c397c85a6074f04a87b923a81cb77bdf1296c7 Mon Sep 17 00:00:00 2001 From: Eugene Shamaev Date: Sat, 6 May 2017 12:11:40 +0300 Subject: [PATCH] APMrover2: move of CAN parameters into separate group --- APMrover2/Parameters.cpp | 6 ++++++ APMrover2/Parameters.h | 1 + APMrover2/Rover.h | 6 ++++++ APMrover2/system.cpp | 3 +++ 4 files changed, 16 insertions(+) diff --git a/APMrover2/Parameters.cpp b/APMrover2/Parameters.cpp index 3458f06f76..69ce0ae7e1 100644 --- a/APMrover2/Parameters.cpp +++ b/APMrover2/Parameters.cpp @@ -470,6 +470,12 @@ const AP_Param::Info Rover::var_info[] = { // @Path: ../libraries/AP_BoardConfig/AP_BoardConfig.cpp GOBJECT(BoardConfig, "BRD_", AP_BoardConfig), +#if HAL_WITH_UAVCAN + // @Group: CAN_ + // @Path: ../libraries/AP_BoardConfig/AP_BoardConfig_CAN.cpp + GOBJECT(BoardConfig_CAN, "CAN_", AP_BoardConfig_CAN), +#endif + // GPS driver // @Group: GPS_ // @Path: ../libraries/AP_GPS/AP_GPS.cpp diff --git a/APMrover2/Parameters.h b/APMrover2/Parameters.h index ccd7d6daaa..bcfe0b5ed3 100644 --- a/APMrover2/Parameters.h +++ b/APMrover2/Parameters.h @@ -22,6 +22,7 @@ public: // k_param_format_version = 0, k_param_software_type, + k_param_BoardConfig_CAN, // Misc // diff --git a/APMrover2/Rover.h b/APMrover2/Rover.h index 404a5cd430..a43e686aa2 100644 --- a/APMrover2/Rover.h +++ b/APMrover2/Rover.h @@ -61,6 +61,7 @@ #include #include #include +#include #include #include "AP_Arming.h" @@ -129,6 +130,11 @@ private: // board specific config AP_BoardConfig BoardConfig; +#if HAL_WITH_UAVCAN + // board specific config for CAN bus + AP_BoardConfig_CAN BoardConfig_CAN; +#endif + // primary control channels RC_Channel *channel_steer; RC_Channel *channel_throttle; diff --git a/APMrover2/system.cpp b/APMrover2/system.cpp index 631301f2b2..9539e80149 100644 --- a/APMrover2/system.cpp +++ b/APMrover2/system.cpp @@ -107,6 +107,9 @@ void Rover::init_ardupilot() hal.scheduler->register_delay_callback(mavlink_delay_cb_static, 5); BoardConfig.init(); +#if HAL_WITH_UAVCAN + BoardConfig_CAN.init(); +#endif // initialise notify system notify.init(false);