From e5437deae2fc91368d849b76b514e728ac34398f Mon Sep 17 00:00:00 2001 From: jgromes Date: Tue, 30 Jun 2020 10:45:45 +0200 Subject: [PATCH] [Morse] Reworked driver exclusion --- src/protocols/Morse/Morse.cpp | 5 +++++ src/protocols/Morse/Morse.h | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/protocols/Morse/Morse.cpp b/src/protocols/Morse/Morse.cpp index fe516132..bd336229 100644 --- a/src/protocols/Morse/Morse.cpp +++ b/src/protocols/Morse/Morse.cpp @@ -1,14 +1,17 @@ #include "Morse.h" +#if !defined(RADIOLIB_EXCLUDE_MORSE) MorseClient::MorseClient(PhysicalLayer* phy) { _phy = phy; _audio = nullptr; } +#if !defined(RADIOLIB_EXCLUDE_AFSK) MorseClient::MorseClient(AFSKClient* audio) { _phy = audio->_phy; _audio = audio; } +#endif int16_t MorseClient::begin(float base, uint8_t speed) { // calculate 24-bit frequency @@ -309,3 +312,5 @@ int16_t MorseClient::standby() { return(_phy->standby()); } } + +#endif diff --git a/src/protocols/Morse/Morse.h b/src/protocols/Morse/Morse.h index e09fece0..276a443b 100644 --- a/src/protocols/Morse/Morse.h +++ b/src/protocols/Morse/Morse.h @@ -1,4 +1,4 @@ -#ifndef _RADIOLIB_MORSE_H +#if !defined(_RADIOLIB_MORSE_H) && !defined(RADIOLIB_EXCLUDE_MORSE) #define _RADIOLIB_MORSE_H #include "../../TypeDef.h" @@ -95,12 +95,14 @@ class MorseClient { */ MorseClient(PhysicalLayer* phy); + #if !defined(RADIOLIB_EXCLUDE_AFSK) /*! \brief Constructor for AFSK mode. \param audio Pointer to the AFSK instance providing audio. */ MorseClient(AFSKClient* audio); + #endif // basic methods @@ -153,7 +155,11 @@ class MorseClient { private: #endif PhysicalLayer* _phy; + #if !defined(RADIOLIB_EXCLUDE_AFSK) AFSKClient* _audio; + #else + void* _audio; + #endif uint32_t _base, _baseHz; uint16_t _dotLength;