[Morse] Reworked driver exclusion

This commit is contained in:
jgromes 2020-06-30 10:45:45 +02:00
parent 7a22cbfd4d
commit e5437deae2
2 changed files with 12 additions and 1 deletions

View file

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

View file

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