From b8c2a18eaf2709c27701dcc2d5c1385c11a0f0a9 Mon Sep 17 00:00:00 2001 From: bugobliterator Date: Thu, 22 Jul 2021 22:21:32 +0530 Subject: [PATCH] AP_BattMonitor: use separate register_driver method while contructing CAN Driver --- .../AP_BattMonitor/AP_BattMonitor_MPPT_PacketDigital.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/AP_BattMonitor/AP_BattMonitor_MPPT_PacketDigital.h b/libraries/AP_BattMonitor/AP_BattMonitor_MPPT_PacketDigital.h index 85fb1b4ed5..5bbd78ded5 100644 --- a/libraries/AP_BattMonitor/AP_BattMonitor_MPPT_PacketDigital.h +++ b/libraries/AP_BattMonitor/AP_BattMonitor_MPPT_PacketDigital.h @@ -20,8 +20,10 @@ public: // construct the CAN Sensor AP_BattMonitor_MPPT_PacketDigital(AP_BattMonitor &mon, AP_BattMonitor::BattMonitor_State &mon_state, AP_BattMonitor_Params ¶ms): AP_BattMonitor_Backend(mon, mon_state, params), - CANSensor("MPPT", AP_CANManager::Driver_Type_MPPT_PacketDigital) - { }; + CANSensor("MPPT") + { + register_driver(AP_CANManager::Driver_Type_MPPT_PacketDigital); + } /// Read the battery voltage and current. Should be called at 10hz void read() override;