AP_BattMonitor: add and use AP_BATTMON_SMBUS_SOLO_ENABLED

This commit is contained in:
Peter Barker 2023-01-25 15:42:24 +11:00 committed by Peter Barker
parent 6b088c6a83
commit eab6ef72e1
2 changed files with 6 additions and 1 deletions

View File

@ -265,10 +265,12 @@ AP_BattMonitor::init()
case Type::ANALOG_VOLTAGE_AND_CURRENT:
drivers[instance] = new AP_BattMonitor_Analog(*this, state[instance], _params[instance]);
break;
#if AP_BATTMON_SMBUS_ENABLE
#if AP_BATTMON_SMBUS_SOLO_ENABLED
case Type::SOLO:
drivers[instance] = new AP_BattMonitor_SMBus_Solo(*this, state[instance], _params[instance]);
break;
#endif
#if AP_BATTMON_SMBUS_ENABLE
case Type::SMBus_Generic:
drivers[instance] = new AP_BattMonitor_SMBus_Generic(*this, state[instance], _params[instance]);
break;

View File

@ -20,3 +20,6 @@
#define AP_BATTMON_SYNTHETIC_CURRENT_ENABLED 1
#endif
#ifndef AP_BATTMON_SMBUS_SOLO_ENABLED
#define AP_BATTMON_SMBUS_SOLO_ENABLED 0 // turned on in hwdefs
#endif