BattMon: remove #defines for monitor type

This commit is contained in:
Randy Mackay 2014-12-04 16:05:28 +09:00
parent f077ecd338
commit 76a28a962c
2 changed files with 3 additions and 9 deletions

View File

@ -11,7 +11,7 @@ const AP_Param::GroupInfo AP_BattMonitor::var_info[] PROGMEM = {
// @Description: Controls enabling monitoring of the battery's voltage and current
// @Values: 0:Disabled,3:Voltage Only,4:Voltage and Current
// @User: Standard
AP_GROUPINFO("_MONITOR", 0, AP_BattMonitor, _monitoring[0], AP_BATT_MONITOR_DISABLED),
AP_GROUPINFO("_MONITOR", 0, AP_BattMonitor, _monitoring[0], BattMonitor_TYPE_NONE),
// @Param: VOLT_PIN
// @DisplayName: Battery Voltage sensing pin
@ -64,7 +64,7 @@ const AP_Param::GroupInfo AP_BattMonitor::var_info[] PROGMEM = {
// @Description: Controls enabling monitoring of the battery's voltage and current
// @Values: 0:Disabled,3:Voltage Only,4:Voltage and Current
// @User: Standard
AP_GROUPINFO("2_MONITOR", 11, AP_BattMonitor, _monitoring[1], AP_BATT_MONITOR_DISABLED),
AP_GROUPINFO("2_MONITOR", 11, AP_BattMonitor, _monitoring[1], BattMonitor_TYPE_NONE),
// @Param: 2_VOLT_PIN
// @DisplayName: Battery Voltage sensing pin
@ -182,7 +182,7 @@ bool AP_BattMonitor::has_current(uint8_t instance) const
// check for analog voltage and current monitor or smbus monitor
if (instance < AP_BATT_MONITOR_MAX_INSTANCES) {
if (drivers[instance] != NULL) {
return (_monitoring[instance] == AP_BATT_MONITOR_VOLTAGE_AND_CURRENT || _monitoring[instance] == AP_BATT_MONITOR_SMBUS);
return (_monitoring[instance] == BattMonitor_TYPE_ANALOG_VOLTAGE_AND_CURRENT || _monitoring[instance] == RangeFinder_TYPE_SMBUS);
}
}

View File

@ -12,12 +12,6 @@
// first monitor is always the primary monitor
#define AP_BATT_PRIMARY_INSTANCE 0
// battery monitor
#define AP_BATT_MONITOR_DISABLED 0
#define AP_BATT_MONITOR_VOLTAGE_ONLY 3
#define AP_BATT_MONITOR_VOLTAGE_AND_CURRENT 4
#define AP_BATT_MONITOR_SMBUS 5
#define AP_BATT_CAPACITY_DEFAULT 3300
#define AP_BATT_LOW_VOLT_TIMEOUT_MS 10000 // low voltage of 10 seconds will cause battery_exhausted to return true