Browse Source

BattMon: correct typo in monitor type enum

mission-4.1.18
Randy Mackay 10 years ago
parent
commit
aecc8aac1f
  1. 4
      libraries/AP_BattMonitor/AP_BattMonitor.cpp
  2. 2
      libraries/AP_BattMonitor/AP_BattMonitor.h

4
libraries/AP_BattMonitor/AP_BattMonitor.cpp

@ -143,7 +143,7 @@ AP_BattMonitor::init()
_num_instances++; _num_instances++;
// check for SMBus // check for SMBus
} else if (monitor_type == RangeFinder_TYPE_SMBUS) { } else if (monitor_type == BattMonitor_TYPE_SMBUS) {
state[instance].instance = instance; state[instance].instance = instance;
#if CONFIG_HAL_BOARD == HAL_BOARD_PX4 #if CONFIG_HAL_BOARD == HAL_BOARD_PX4
drivers[instance] = new AP_BattMonitor_SMBus_PX4(*this, instance, state[instance]); drivers[instance] = new AP_BattMonitor_SMBus_PX4(*this, instance, state[instance]);
@ -182,7 +182,7 @@ bool AP_BattMonitor::has_current(uint8_t instance) const
// check for analog voltage and current monitor or smbus monitor // check for analog voltage and current monitor or smbus monitor
if (instance < AP_BATT_MONITOR_MAX_INSTANCES) { if (instance < AP_BATT_MONITOR_MAX_INSTANCES) {
if (drivers[instance] != NULL) { if (drivers[instance] != NULL) {
return (_monitoring[instance] == BattMonitor_TYPE_ANALOG_VOLTAGE_AND_CURRENT || _monitoring[instance] == RangeFinder_TYPE_SMBUS); return (_monitoring[instance] == BattMonitor_TYPE_ANALOG_VOLTAGE_AND_CURRENT || _monitoring[instance] == BattMonitor_TYPE_SMBUS);
} }
} }

2
libraries/AP_BattMonitor/AP_BattMonitor.h

@ -40,7 +40,7 @@ public:
BattMonitor_TYPE_NONE = 0, BattMonitor_TYPE_NONE = 0,
BattMonitor_TYPE_ANALOG_VOLTAGE_ONLY = 3, BattMonitor_TYPE_ANALOG_VOLTAGE_ONLY = 3,
BattMonitor_TYPE_ANALOG_VOLTAGE_AND_CURRENT = 4, BattMonitor_TYPE_ANALOG_VOLTAGE_AND_CURRENT = 4,
RangeFinder_TYPE_SMBUS = 5 BattMonitor_TYPE_SMBUS = 5
}; };
// The BattMonitor_State structure is filled in by the backend driver // The BattMonitor_State structure is filled in by the backend driver

Loading…
Cancel
Save