VOXL2 specific drivers, modules, and miscellaneous support files (#22588)

This commit is contained in:
Eric Katzfey
2024-01-18 12:14:17 -05:00
committed by GitHub
parent b60e73c76f
commit 2b69a3d290
96 changed files with 8266 additions and 678 deletions
+6 -2
View File
@@ -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));