From 5d154b138a8cb32bb4d93b49ee484586405d1264 Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Tue, 23 Feb 2021 22:06:37 +0000 Subject: [PATCH] AP_Vehicle: generalise ESC telemetry to allow harmonic notch handling with other ESCs log ESC telemetry data in frontend --- libraries/AP_Vehicle/AP_Vehicle.cpp | 4 ++++ libraries/AP_Vehicle/AP_Vehicle.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/libraries/AP_Vehicle/AP_Vehicle.cpp b/libraries/AP_Vehicle/AP_Vehicle.cpp index b5b6f0aa7e..e814e0dcbf 100644 --- a/libraries/AP_Vehicle/AP_Vehicle.cpp +++ b/libraries/AP_Vehicle/AP_Vehicle.cpp @@ -175,6 +175,7 @@ void AP_Vehicle::setup() #if GENERATOR_ENABLED generator.init(); #endif + } void AP_Vehicle::loop() @@ -221,6 +222,9 @@ const AP_Scheduler::Task AP_Vehicle::scheduler_tasks[] = { SCHED_TASK(update_dynamic_notch, 200, 200), SCHED_TASK_CLASS(AP_VideoTX, &vehicle.vtx, update, 2, 100), SCHED_TASK(send_watchdog_reset_statustext, 0.1, 20), +#if HAL_WITH_ESC_TELEM + SCHED_TASK_CLASS(AP_ESC_Telem, &vehicle.esc_telem, update, 10, 50), +#endif #if GENERATOR_ENABLED SCHED_TASK_CLASS(AP_Generator, &vehicle.generator, update, 10, 50), #endif diff --git a/libraries/AP_Vehicle/AP_Vehicle.h b/libraries/AP_Vehicle/AP_Vehicle.h index 3886134228..880ea4e586 100644 --- a/libraries/AP_Vehicle/AP_Vehicle.h +++ b/libraries/AP_Vehicle/AP_Vehicle.h @@ -307,7 +307,9 @@ protected: AP_VisualOdom visual_odom; #endif +#if HAL_WITH_ESC_TELEM AP_ESC_Telem esc_telem; +#endif #if HAL_MSP_ENABLED AP_MSP msp;