diff --git a/ArduCopter/Copter.h b/ArduCopter/Copter.h index 088059e4f1..f6abd52f1e 100644 --- a/ArduCopter/Copter.h +++ b/ArduCopter/Copter.h @@ -83,6 +83,7 @@ #include // Notify library #include // Battery monitor library #include // board configuration library +#include #include // Landing Gear library #include #include @@ -317,6 +318,11 @@ private: // board specific config AP_BoardConfig BoardConfig; +#if HAL_WITH_UAVCAN + // board specific config for CAN bus + AP_BoardConfig_CAN BoardConfig_CAN; +#endif + // receiver RSSI uint8_t receiver_rssi; diff --git a/ArduCopter/Parameters.cpp b/ArduCopter/Parameters.cpp index c48f62f092..53460e71b8 100644 --- a/ArduCopter/Parameters.cpp +++ b/ArduCopter/Parameters.cpp @@ -738,6 +738,12 @@ const AP_Param::Info Copter::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 SPRAYER == ENABLED // @Group: SPRAY_ // @Path: ../libraries/AC_Sprayer/AC_Sprayer.cpp diff --git a/ArduCopter/Parameters.h b/ArduCopter/Parameters.h index a464ad9f03..24d4b62fb9 100644 --- a/ArduCopter/Parameters.h +++ b/ArduCopter/Parameters.h @@ -55,6 +55,7 @@ public: k_param_NavEKF2, k_param_g2, // 2nd block of parameters k_param_NavEKF3, + k_param_BoardConfig_CAN, // simulation k_param_sitl = 10, diff --git a/ArduCopter/system.cpp b/ArduCopter/system.cpp index c8cc390ae7..cbbd94adb9 100644 --- a/ArduCopter/system.cpp +++ b/ArduCopter/system.cpp @@ -127,6 +127,9 @@ void Copter::init_ardupilot() hal.scheduler->register_delay_callback(mavlink_delay_cb_static, 5); BoardConfig.init(); +#if HAL_WITH_UAVCAN + BoardConfig_CAN.init(); +#endif // init cargo gripper #if GRIPPER_ENABLED == ENABLED