AP_Volz_Protocol: allow Volz protocol to be compiled out

This commit is contained in:
Peter Barker 2022-04-08 17:20:50 +10:00 committed by Andrew Tridgell
parent 2e20e26403
commit d97c847966
2 changed files with 17 additions and 5 deletions

View File

@ -4,13 +4,14 @@
* Created on: Oct 31, 2017 * Created on: Oct 31, 2017
* Author: guy * Author: guy
*/ */
#include <AP_HAL/AP_HAL.h>
#include <SRV_Channel/SRV_Channel.h>
#include "AP_Volz_Protocol.h" #include "AP_Volz_Protocol.h"
#if NUM_SERVO_CHANNELS
#if AP_VOLZ_ENABLED
#include <AP_HAL/AP_HAL.h>
#include <AP_SerialManager/AP_SerialManager.h> #include <AP_SerialManager/AP_SerialManager.h>
#include <SRV_Channel/SRV_Channel.h>
extern const AP_HAL::HAL& hal; extern const AP_HAL::HAL& hal;
@ -158,4 +159,5 @@ void AP_Volz_Protocol::update_volz_bitmask(uint32_t new_bitmask)
volz_time_frame_micros = channels_micros; volz_time_frame_micros = channels_micros;
} }
#endif //NUM_SERVO_CHANNELS
#endif // AP_VOLZ_ENABLED

View File

@ -33,6 +33,14 @@
#pragma once #pragma once
#include <AP_HAL/AP_HAL_Boards.h>
#ifndef AP_VOLZ_ENABLED
#define AP_VOLZ_ENABLED 1
#endif
#if AP_VOLZ_ENABLED
#include <AP_HAL/AP_HAL.h> #include <AP_HAL/AP_HAL.h>
#include <AP_Param/AP_Param.h> #include <AP_Param/AP_Param.h>
@ -73,3 +81,5 @@ private:
AP_Int32 bitmask; AP_Int32 bitmask;
bool initialised; bool initialised;
}; };
#endif // AP_VOLZ_PROTOCOL