From 9acf4c88c850343499d1c377646883207f1f43eb Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 22 Jun 2022 11:30:12 +1000 Subject: [PATCH] AP_Generator: add AP_GENERATOR_RICHENPOWER_ENABLED --- libraries/AP_Generator/AP_Generator.cpp | 2 ++ libraries/AP_Generator/AP_Generator_RichenPower.cpp | 4 ++-- libraries/AP_Generator/AP_Generator_RichenPower.h | 6 +++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/libraries/AP_Generator/AP_Generator.cpp b/libraries/AP_Generator/AP_Generator.cpp index 2458eeade7..2e9fba8372 100644 --- a/libraries/AP_Generator/AP_Generator.cpp +++ b/libraries/AP_Generator/AP_Generator.cpp @@ -74,7 +74,9 @@ void AP_Generator::init() break; case Type::RICHENPOWER: +#if AP_GENERATOR_RICHENPOWER_ENABLED _driver_ptr = new AP_Generator_RichenPower(*this); +#endif break; } diff --git a/libraries/AP_Generator/AP_Generator_RichenPower.cpp b/libraries/AP_Generator/AP_Generator_RichenPower.cpp index 93fdaf304c..99c18f7c71 100644 --- a/libraries/AP_Generator/AP_Generator_RichenPower.cpp +++ b/libraries/AP_Generator/AP_Generator_RichenPower.cpp @@ -15,7 +15,7 @@ #include "AP_Generator_RichenPower.h" -#if HAL_GENERATOR_ENABLED +#if AP_GENERATOR_RICHENPOWER_ENABLED #include #include @@ -512,4 +512,4 @@ bool AP_Generator_RichenPower::run() set_pilot_desired_runstate(RunState::RUN); return true; } -#endif +#endif // AP_GENERATOR_RICHENPOWER_ENABLED diff --git a/libraries/AP_Generator/AP_Generator_RichenPower.h b/libraries/AP_Generator/AP_Generator_RichenPower.h index cbc6d85246..3297bba3a4 100644 --- a/libraries/AP_Generator/AP_Generator_RichenPower.h +++ b/libraries/AP_Generator/AP_Generator_RichenPower.h @@ -3,7 +3,11 @@ #include "AP_Generator_Backend.h" -#if HAL_GENERATOR_ENABLED +#ifndef AP_GENERATOR_RICHENPOWER_ENABLED +#define AP_GENERATOR_RICHENPOWER_ENABLED 0 +#endif + +#if AP_GENERATOR_RICHENPOWER_ENABLED #include #include