From 129eb4c184a9c14c5673911e8a30666b414dfc2f Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 1 Sep 2021 09:04:17 +1000 Subject: [PATCH] AP_HAL_SITL: do not overwrite FETTecESC telemetry data w/SITL ESC data --- libraries/AP_HAL_SITL/RCOutput.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libraries/AP_HAL_SITL/RCOutput.cpp b/libraries/AP_HAL_SITL/RCOutput.cpp index 7f32337c84795..b1df8706a14ac 100644 --- a/libraries/AP_HAL_SITL/RCOutput.cpp +++ b/libraries/AP_HAL_SITL/RCOutput.cpp @@ -85,6 +85,14 @@ void RCOutput::push(void) memcpy(_sitlState->pwm_output, _pending, SITL_NUM_CHANNELS * sizeof(uint16_t)); _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; }