diff --git a/libraries/AP_BattMonitor/AP_BattMonitor_MPPT_PacketDigital.h b/libraries/AP_BattMonitor/AP_BattMonitor_MPPT_PacketDigital.h index f8e6090078..85fb1b4ed5 100644 --- a/libraries/AP_BattMonitor/AP_BattMonitor_MPPT_PacketDigital.h +++ b/libraries/AP_BattMonitor/AP_BattMonitor_MPPT_PacketDigital.h @@ -5,7 +5,7 @@ #include #ifndef HAL_MPPT_PACKETDIGITAL_CAN_ENABLE - #define HAL_MPPT_PACKETDIGITAL_CAN_ENABLE HAL_MAX_CAN_PROTOCOL_DRIVERS && BOARD_FLASH_SIZE > 1024 + #define HAL_MPPT_PACKETDIGITAL_CAN_ENABLE (!defined(HAL_BUILD_AP_PERIPH) && HAL_MAX_CAN_PROTOCOL_DRIVERS && BOARD_FLASH_SIZE > 1024) || (defined(HAL_BUILD_AP_PERIPH) && defined(HAL_PERIPH_ENABLE_BATTERY_MPPT_PACKETDIGITAL)) #endif #if HAL_MPPT_PACKETDIGITAL_CAN_ENABLE