From ee2118f93a1180716ccf7663ec2fb233f1c869a2 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 7 Nov 2019 11:43:07 +1100 Subject: [PATCH] Plane: add support for AP_Generator --- ArduPlane/ArduPlane.cpp | 3 +++ ArduPlane/system.cpp | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/ArduPlane/ArduPlane.cpp b/ArduPlane/ArduPlane.cpp index 67c92216da..d68599ffac 100644 --- a/ArduPlane/ArduPlane.cpp +++ b/ArduPlane/ArduPlane.cpp @@ -104,6 +104,9 @@ const AP_Scheduler::Task Plane::scheduler_tasks[] = { #if OSD_ENABLED == ENABLED SCHED_TASK(publish_osd_info, 1, 10), #endif +#if GENERATOR_ENABLED + SCHED_TASK_CLASS(AP_Generator_RichenPower, &plane.generator, update, 10, 50), +#endif #if LANDING_GEAR_ENABLED == ENABLED SCHED_TASK(landing_gear_update, 5, 50), #endif diff --git a/ArduPlane/system.cpp b/ArduPlane/system.cpp index 0f2dd4c7b9..e4cfa23869 100644 --- a/ArduPlane/system.cpp +++ b/ArduPlane/system.cpp @@ -69,6 +69,10 @@ void Plane::init_ardupilot() // setup telem slots with serial ports gcs().setup_uarts(); +#if GENERATOR_ENABLED + generator.init(); +#endif + #if OSD_ENABLED == ENABLED osd.init(); #endif