AP_BattMonitor: added BATT_MONITOR_DEFAULT option

this is for boards with builtin current and voltage monitoring
This commit is contained in:
Andrew Tridgell 2018-10-31 08:26:54 +11:00
parent 78a32df2e7
commit 1a5d60609d

View File

@ -91,9 +91,11 @@ AP_BattMonitor::init()
convert_params();
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BEBOP || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_DISCO
// force monitor for bebop
_params[0]._type.set(AP_BattMonitor_Params::BattMonitor_TYPE_BEBOP);
#ifdef HAL_BATT_MONITOR_DEFAULT
if (_params[0]._type == 0) {
// we can't use set_default() as the type is used as a flag for parameter conversion
_params[0]._type.set((AP_BattMonitor_Params::BattMonitor_Type)HAL_BATT_MONITOR_DEFAULT);
}
#endif
// create each instance