[RTTY] Fixed exclusion macros
This commit is contained in:
parent
27471fd788
commit
dabac56cc4
2 changed files with 16 additions and 7 deletions
|
@ -107,7 +107,9 @@ uint16_t ITA2String::getBits(char c) {
|
|||
|
||||
RTTYClient::RTTYClient(PhysicalLayer* phy) {
|
||||
_phy = phy;
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
_audio = nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
|
@ -161,9 +163,11 @@ int16_t RTTYClient::begin(float base, uint32_t shift, uint16_t rate, uint8_t enc
|
|||
|
||||
// set module frequency deviation to 0 if using FSK
|
||||
int16_t state = ERR_NONE;
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
if(_audio == nullptr) {
|
||||
state = _phy->setFrequencyDeviation(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
return(state);
|
||||
}
|
||||
|
@ -520,19 +524,21 @@ size_t RTTYClient::printFloat(double number, uint8_t digits) {
|
|||
}
|
||||
|
||||
int16_t RTTYClient::transmitDirect(uint32_t freq, uint32_t freqHz) {
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
if(_audio != nullptr) {
|
||||
return(_audio->tone(freqHz));
|
||||
} else {
|
||||
return(_phy->transmitDirect(freq));
|
||||
}
|
||||
#endif
|
||||
return(_phy->transmitDirect(freq));
|
||||
}
|
||||
|
||||
int16_t RTTYClient::standby() {
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
if(_audio != nullptr) {
|
||||
return(_audio->noTone());
|
||||
} else {
|
||||
return(_phy->standby());
|
||||
}
|
||||
#endif
|
||||
return(_phy->standby());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
#if !defined(_RADIOLIB_RTTY_H) && !defined(RADIOLIB_EXCLUDE_RTTY)
|
||||
#if !defined(_RADIOLIB_RTTY_H)
|
||||
#define _RADIOLIB_RTTY_H
|
||||
|
||||
#include "../../TypeDef.h"
|
||||
|
||||
#if !defined(RADIOLIB_EXCLUDE_RTTY)
|
||||
|
||||
#include "../PhysicalLayer/PhysicalLayer.h"
|
||||
#include "../AFSK/AFSK.h"
|
||||
|
||||
|
@ -159,8 +162,6 @@ class RTTYClient {
|
|||
PhysicalLayer* _phy;
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
AFSKClient* _audio;
|
||||
#else
|
||||
void* _audio;
|
||||
#endif
|
||||
|
||||
uint8_t _encoding = ASCII;
|
||||
|
@ -181,3 +182,5 @@ class RTTYClient {
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue