mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 13:03:34 +08:00
VOXL2 specific drivers, modules, and miscellaneous support files (#22588)
This commit is contained in:
@@ -74,7 +74,6 @@ VOXLPM::init()
|
||||
_battery.setConnected(false);
|
||||
_battery.updateVoltage(0.f);
|
||||
_battery.updateCurrent(0.f);
|
||||
_battery.updateAndPublishBatteryStatus(hrt_absolute_time());
|
||||
}
|
||||
|
||||
/* do I2C init, it will probe the bus for two possible configurations, LTC2946 or INA231 */
|
||||
@@ -82,6 +81,11 @@ VOXLPM::init()
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Don't actually publish anything unless we have had a successful probe
|
||||
if (_ch_type == VOXLPM_CH_TYPE_VBATT) {
|
||||
_battery.updateAndPublishBatteryStatus(hrt_absolute_time());
|
||||
}
|
||||
|
||||
/* If we've probed and succeeded we'll have an accurate address here for the VBat addr */
|
||||
uint8_t addr = get_device_address();
|
||||
|
||||
@@ -420,7 +424,7 @@ VOXLPM::measure_ina231()
|
||||
|
||||
int16_t vshunt = -1;
|
||||
uint16_t vbus = -1;
|
||||
uint16_t amps = 0;
|
||||
int16_t amps = 0;
|
||||
|
||||
int vshunt_ret = read_reg_buf(INA231_REG_SHUNTVOLTAGE, raw_vshunt, sizeof(raw_vshunt));
|
||||
int vbus_ret = read_reg_buf(INA231_REG_BUSVOLTAGE, raw_vbus, sizeof(raw_vbus));
|
||||
|
||||
Reference in New Issue
Block a user