From 55ebbc348802618b1450928d7751d4718d2ccdca Mon Sep 17 00:00:00 2001 From: jgromes Date: Tue, 30 Jun 2020 10:45:00 +0200 Subject: [PATCH] [AX25] Reworked driver exclusion --- src/protocols/AX25/AX25.cpp | 5 +++++ src/protocols/AX25/AX25.h | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/protocols/AX25/AX25.cpp b/src/protocols/AX25/AX25.cpp index 1693cbe7..579ed8f1 100644 --- a/src/protocols/AX25/AX25.cpp +++ b/src/protocols/AX25/AX25.cpp @@ -1,4 +1,5 @@ #include "AX25.h" +#if !defined(RADIOLIB_EXCLUDE_AX25) AX25Frame::AX25Frame(const char* destCallsign, uint8_t destSSID, const char* srcCallsign, uint8_t srcSSID, uint8_t control) : AX25Frame(destCallsign, destSSID, srcCallsign, srcSSID, control, 0, NULL, 0) { @@ -115,10 +116,12 @@ AX25Client::AX25Client(PhysicalLayer* phy) { _audio = nullptr; } +#if !defined(RADIOLIB_EXCLUDE_AFSK) AX25Client::AX25Client(AFSKClient* audio) { _phy = audio->_phy; _audio = audio; } +#endif int16_t AX25Client::begin(const char* srcCallsign, uint8_t srcSSID, uint8_t preambleLen) { // set source SSID @@ -414,3 +417,5 @@ uint16_t AX25Client::flipBits16(uint16_t i) { i = (i & 0xAAAA) >> 1 | (i & 0x5555) << 1; return i; } + +#endif diff --git a/src/protocols/AX25/AX25.h b/src/protocols/AX25/AX25.h index dc385dfa..c751a7c1 100644 --- a/src/protocols/AX25/AX25.h +++ b/src/protocols/AX25/AX25.h @@ -1,4 +1,4 @@ -#ifndef _RADIOLIB_AX25_H +#if !defined(_RADIOLIB_AX25_H) && !defined(RADIOLIB_EXCLUDE_AX25) #define _RADIOLIB_AX25_H #include "../../TypeDef.h" @@ -268,12 +268,14 @@ class AX25Client { */ AX25Client(PhysicalLayer* phy); + #if !defined(RADIOLIB_EXCLUDE_AFSK) /*! \brief Constructor for AFSK mode. \param audio Pointer to the AFSK instance providing audio. */ AX25Client(AFSKClient* audio); + #endif // basic methods @@ -316,7 +318,11 @@ class AX25Client { private: #endif PhysicalLayer* _phy; + #if !defined(RADIOLIB_EXCLUDE_AFSK) AFSKClient* _audio; + #else + void* _audio; + #endif char _srcCallsign[AX25_MAX_CALLSIGN_LEN + 1]; uint8_t _srcSSID;