AP_HAL_SITL: use parameter to enable/disable SITL ESC telem

this is the perfect telemetry stream; we don't want to override other telemetry streams
This commit is contained in:
Peter Barker 2023-01-18 15:19:29 +11:00 committed by Andrew Tridgell
parent aa7ab28969
commit ccf290246c
1 changed files with 7 additions and 11 deletions

View File

@ -88,18 +88,14 @@ void RCOutput::push(void)
_corked = false;
}
// do not overwrite FETTec simulation's ESC telemetry data:
SITL::SIM *sitl = AP::sitl();
if (sitl != nullptr &&
sitl->fetteconewireesc_sim.enabled()) {
return;
}
if (esc_telem == nullptr) {
esc_telem = new AP_ESC_Telem_SITL;
}
if (esc_telem != nullptr) {
esc_telem->update();
if (sitl && sitl->esc_telem) {
if (esc_telem == nullptr) {
esc_telem = new AP_ESC_Telem_SITL;
}
if (esc_telem != nullptr) {
esc_telem->update();
}
}
}