diff --git a/libraries/AP_RPM/AP_RPM.cpp b/libraries/AP_RPM/AP_RPM.cpp index 11c1bd89e8..a0d9105458 100644 --- a/libraries/AP_RPM/AP_RPM.cpp +++ b/libraries/AP_RPM/AP_RPM.cpp @@ -23,6 +23,7 @@ #include "RPM_Generator.h" #include "RPM_HarmonicNotch.h" #include "RPM_ESC_Telem.h" +#include "AP_ESC_Telem/AP_ESC_Telem.h" #include @@ -199,6 +200,19 @@ void AP_RPM::update(void) } drivers[i]->update(); + +#if HAL_WITH_ESC_TELEM + // Check if we need to write to esc_telem(). Note: + // RPM_TYPE_ESC_TELEM = read ESC_TELEM and store it in AP_RPM + // RPM_TYPE_EverythingElse = write to ESC_TELEM with data generated from AP_RPM + if (_params[i].type != RPM_TYPE_ESC_TELEM && _params[i].esc_mask > 0 && healthy(i)) { + for (uint32_t esc=0; esc