AP_Relay: add option to disable relay and servorelay libraries

This commit is contained in:
Peter Barker 2023-06-06 18:05:06 +10:00 committed by Peter Barker
parent 2adb4fef5a
commit 72a2962367
3 changed files with 18 additions and 0 deletions

View File

@ -7,6 +7,9 @@
#include <AP_HAL/AP_HAL.h>
#include "AP_Relay.h"
#if AP_RELAY_ENABLED
#include <AP_Logger/AP_Logger.h>
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
@ -195,3 +198,5 @@ AP_Relay *relay()
}
}
#endif // AP_RELAY_ENABLED

View File

@ -9,6 +9,10 @@
/// @brief APM relay control class
#pragma once
#include "AP_Relay_config.h"
#if AP_RELAY_ENABLED
#include <AP_Param/AP_Param.h>
#define AP_RELAY_NUM_RELAYS 6
@ -64,3 +68,5 @@ private:
namespace AP {
AP_Relay *relay();
};
#endif // AP_RELAY_ENABLED

View File

@ -0,0 +1,7 @@
#pragma once
#include <AP_HAL/AP_HAL_Boards.h>
#ifndef AP_RELAY_ENABLED
#define AP_RELAY_ENABLED 1
#endif