AP_Generator: add AP_GENERATOR_RICHENPOWER_ENABLED

This commit is contained in:
Peter Barker 2022-06-22 11:30:12 +10:00 committed by Andrew Tridgell
parent 0d508750bc
commit 9acf4c88c8
3 changed files with 9 additions and 3 deletions

View File

@ -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;
}

View File

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

View File

@ -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 <AP_Common/AP_Common.h>
#include <SRV_Channel/SRV_Channel.h>