mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-21 16:18:29 -04:00
AP_BattMonitor: Add macros for Fuel options
Adds macros for FuelFlow, FuelLevel_PWM, and FuelLevel_Analog. The features are enabled on all 2MB boards.
This commit is contained in:
parent
6733f75542
commit
aa2c6b8d17
@ -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]);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user