mirror of https://github.com/ArduPilot/ardupilot
AP_BattMonitor: fixed SITL segfault
This commit is contained in:
parent
274e441292
commit
c9652fec3c
|
@ -18,7 +18,9 @@ AP_BattMonitor_SMBus::AP_BattMonitor_SMBus(AP_BattMonitor &mon,
|
||||||
}
|
}
|
||||||
|
|
||||||
void AP_BattMonitor_SMBus::init(void) {
|
void AP_BattMonitor_SMBus::init(void) {
|
||||||
_dev->register_periodic_callback(100000, FUNCTOR_BIND_MEMBER(&AP_BattMonitor_SMBus::timer, void));
|
if (_dev) {
|
||||||
|
_dev->register_periodic_callback(100000, FUNCTOR_BIND_MEMBER(&AP_BattMonitor_SMBus::timer, void));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// read the battery_voltage and current, should be called at 10hz
|
/// read the battery_voltage and current, should be called at 10hz
|
||||||
|
|
Loading…
Reference in New Issue