diff --git a/libraries/AP_Generator/AP_Generator_RichenPower.cpp b/libraries/AP_Generator/AP_Generator_RichenPower.cpp
index cbfc2fcdeb..6ce1e2fa85 100644
--- a/libraries/AP_Generator/AP_Generator_RichenPower.cpp
+++ b/libraries/AP_Generator/AP_Generator_RichenPower.cpp
@@ -13,10 +13,12 @@
along with this program. If not, see .
*/
-#include "AP_Generator_RichenPower.h"
+#include "AP_Generator_config.h"
#if AP_GENERATOR_RICHENPOWER_ENABLED
+#include "AP_Generator_RichenPower.h"
+
#include
#include
#include
diff --git a/libraries/AP_Generator/AP_Generator_RichenPower.h b/libraries/AP_Generator/AP_Generator_RichenPower.h
index bd9bfc25d9..2fce45e60c 100644
--- a/libraries/AP_Generator/AP_Generator_RichenPower.h
+++ b/libraries/AP_Generator/AP_Generator_RichenPower.h
@@ -1,10 +1,12 @@
// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
#pragma once
-#include "AP_Generator_Backend.h"
+#include "AP_Generator_config.h"
#if AP_GENERATOR_RICHENPOWER_ENABLED
+#include "AP_Generator_Backend.h"
+
#include
#include
#include
@@ -212,4 +214,4 @@ private:
// maintenamce, this is the last time we sent the warning:
uint32_t last_maintenance_warning_ms;
};
-#endif
+#endif // AP_GENERATOR_RICHENPOWER_ENABLED