diff --git a/ArduPlane/Parameters.cpp b/ArduPlane/Parameters.cpp index f60d25abd8..a8b71176b0 100644 --- a/ArduPlane/Parameters.cpp +++ b/ArduPlane/Parameters.cpp @@ -1088,6 +1088,12 @@ const AP_Param::Info Plane::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 + #if CONFIG_HAL_BOARD == HAL_BOARD_SITL // @Group: SIM_ // @Path: ../libraries/SITL/SITL.cpp diff --git a/ArduPlane/Parameters.h b/ArduPlane/Parameters.h index 70874fe020..11306d17ab 100644 --- a/ArduPlane/Parameters.h +++ b/ArduPlane/Parameters.h @@ -53,6 +53,7 @@ public: k_param_avoidance_adsb, k_param_landing, k_param_NavEKF3, + k_param_BoardConfig_CAN, // Misc // diff --git a/ArduPlane/Plane.h b/ArduPlane/Plane.h index 25b351ab93..5f6b5abf3b 100644 --- a/ArduPlane/Plane.h +++ b/ArduPlane/Plane.h @@ -82,6 +82,7 @@ #include #include +#include #include #include @@ -172,6 +173,11 @@ private: // board specific config AP_BoardConfig BoardConfig; + // board specific config for CAN bus +#if HAL_WITH_UAVCAN + AP_BoardConfig_CAN BoardConfig_CAN; +#endif + // primary input channels RC_Channel *channel_roll; RC_Channel *channel_pitch; diff --git a/ArduPlane/system.cpp b/ArduPlane/system.cpp index 221d2b65d8..10248db22a 100644 --- a/ArduPlane/system.cpp +++ b/ArduPlane/system.cpp @@ -140,6 +140,9 @@ void Plane::init_ardupilot() // setup any board specific drivers BoardConfig.init(); +#if HAL_WITH_UAVCAN + BoardConfig_CAN.init(); +#endif relay.init();