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