[RTTY] Reworked driver exclusion

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

View file

@ -1,4 +1,5 @@
#include "RTTY.h"
#if !defined(RADIOLIB_EXCLUDE_RTTY)
ITA2String::ITA2String(char c) {
_len = 1;
@ -109,10 +110,12 @@ RTTYClient::RTTYClient(PhysicalLayer* phy) {
_audio = nullptr;
}
#if !defined(RADIOLIB_EXCLUDE_AFSK)
RTTYClient::RTTYClient(AFSKClient* audio) {
_phy = audio->_phy;
_audio = audio;
}
#endif
int16_t RTTYClient::begin(float base, uint32_t shift, uint16_t rate, uint8_t encoding, uint8_t stopBits) {
// save configuration
@ -531,3 +534,5 @@ int16_t RTTYClient::standby() {
return(_phy->standby());
}
}
#endif

View file

@ -1,4 +1,4 @@
#ifndef _RADIOLIB_RTTY_H
#if !defined(_RADIOLIB_RTTY_H) && !defined(RADIOLIB_EXCLUDE_RTTY)
#define _RADIOLIB_RTTY_H
#include "../../TypeDef.h"
@ -91,12 +91,14 @@ class RTTYClient {
*/
RTTYClient(PhysicalLayer* phy);
#if !defined(RADIOLIB_EXCLUDE_AFSK)
/*!
\brief Constructor for AFSK mode.
\param audio Pointer to the AFSK instance providing audio.
*/
RTTYClient(AFSKClient* audio);
#endif
// basic methods
@ -155,7 +157,11 @@ class RTTYClient {
private:
#endif
PhysicalLayer* _phy;
#if !defined(RADIOLIB_EXCLUDE_AFSK)
AFSKClient* _audio;
#else
void* _audio;
#endif
uint8_t _encoding;
uint32_t _base, _baseHz;