diff --git a/libraries/AP_BattMonitor/AP_BattMonitor.cpp b/libraries/AP_BattMonitor/AP_BattMonitor.cpp index a5c535d6cc..e125bbd0cc 100644 --- a/libraries/AP_BattMonitor/AP_BattMonitor.cpp +++ b/libraries/AP_BattMonitor/AP_BattMonitor.cpp @@ -286,17 +286,21 @@ AP_BattMonitor::init() case Type::Sum: drivers[instance] = new AP_BattMonitor_Sum(*this, state[instance], _params[instance], instance); break; -#if AP_BATTMON_FUEL_ENABLE +#if AP_BATTMON_FUELFLOW_ENABLE case Type::FuelFlow: drivers[instance] = new AP_BattMonitor_FuelFlow(*this, state[instance], _params[instance]); break; +#endif // AP_BATTMON_FUELFLOW_ENABLE +#if AP_BATTMON_FUELLEVEL_PWM_ENABLE case Type::FuelLevel_PWM: drivers[instance] = new AP_BattMonitor_FuelLevel_PWM(*this, state[instance], _params[instance]); break; +#endif // AP_BATTMON_FUELLEVEL_PWM_ENABLE +#if AP_BATTMON_FUELLEVEL_ANALOG_ENABLE case Type::FuelLevel_Analog: drivers[instance] = new AP_BattMonitor_FuelLevel_Analog(*this, state[instance], _params[instance]); break; -#endif // AP_BATTMON_FUEL_ENABLE +#endif // AP_BATTMON_FUELLEVEL_ANALOG_ENABLE #if HAL_GENERATOR_ENABLED case Type::GENERATOR_ELEC: drivers[instance] = new AP_BattMonitor_Generator_Elec(*this, state[instance], _params[instance]); diff --git a/libraries/AP_BattMonitor/AP_BattMonitor.h b/libraries/AP_BattMonitor/AP_BattMonitor.h index dc54557661..f4eaa68518 100644 --- a/libraries/AP_BattMonitor/AP_BattMonitor.h +++ b/libraries/AP_BattMonitor/AP_BattMonitor.h @@ -31,8 +31,16 @@ #define AP_BATTMON_SMBUS_ENABLE 1 #endif -#ifndef AP_BATTMON_FUEL_ENABLE -#define AP_BATTMON_FUEL_ENABLE 1 +#ifndef AP_BATTMON_FUELFLOW_ENABLE +#define AP_BATTMON_FUELFLOW_ENABLE (BOARD_FLASH_SIZE > 1024) +#endif + +#ifndef AP_BATTMON_FUELLEVEL_PWM_ENABLE +#define AP_BATTMON_FUELLEVEL_PWM_ENABLE (BOARD_FLASH_SIZE > 1024) +#endif + +#ifndef AP_BATTMON_FUELLEVEL_ANALOG_ENABLE +#define AP_BATTMON_FUELLEVEL_ANALOG_ENABLE (BOARD_FLASH_SIZE > 1024) #endif // declare backend class