Browse Source

AP_Generator: add AP_GENERATOR_RICHENPOWER_ENABLED

apm_2208
Peter Barker 3 years ago committed by Andrew Tridgell
parent
commit
9acf4c88c8
  1. 2
      libraries/AP_Generator/AP_Generator.cpp
  2. 4
      libraries/AP_Generator/AP_Generator_RichenPower.cpp
  3. 6
      libraries/AP_Generator/AP_Generator_RichenPower.h

2
libraries/AP_Generator/AP_Generator.cpp

@ -74,7 +74,9 @@ void AP_Generator::init()
break; break;
case Type::RICHENPOWER: case Type::RICHENPOWER:
#if AP_GENERATOR_RICHENPOWER_ENABLED
_driver_ptr = new AP_Generator_RichenPower(*this); _driver_ptr = new AP_Generator_RichenPower(*this);
#endif
break; break;
} }

4
libraries/AP_Generator/AP_Generator_RichenPower.cpp

@ -15,7 +15,7 @@
#include "AP_Generator_RichenPower.h" #include "AP_Generator_RichenPower.h"
#if HAL_GENERATOR_ENABLED #if AP_GENERATOR_RICHENPOWER_ENABLED
#include <AP_Logger/AP_Logger.h> #include <AP_Logger/AP_Logger.h>
#include <AP_SerialManager/AP_SerialManager.h> #include <AP_SerialManager/AP_SerialManager.h>
@ -512,4 +512,4 @@ bool AP_Generator_RichenPower::run()
set_pilot_desired_runstate(RunState::RUN); set_pilot_desired_runstate(RunState::RUN);
return true; return true;
} }
#endif #endif // AP_GENERATOR_RICHENPOWER_ENABLED

6
libraries/AP_Generator/AP_Generator_RichenPower.h

@ -3,7 +3,11 @@
#include "AP_Generator_Backend.h" #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 <AP_Common/AP_Common.h> #include <AP_Common/AP_Common.h>
#include <SRV_Channel/SRV_Channel.h> #include <SRV_Channel/SRV_Channel.h>

Loading…
Cancel
Save