[Morse] Fixed exclusion macros
This commit is contained in:
parent
55845fe3d7
commit
27471fd788
2 changed files with 10 additions and 6 deletions
|
@ -3,7 +3,9 @@
|
||||||
|
|
||||||
MorseClient::MorseClient(PhysicalLayer* phy) {
|
MorseClient::MorseClient(PhysicalLayer* phy) {
|
||||||
_phy = phy;
|
_phy = phy;
|
||||||
|
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||||
_audio = nullptr;
|
_audio = nullptr;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||||
|
@ -23,9 +25,11 @@ int16_t MorseClient::begin(float base, uint8_t speed) {
|
||||||
|
|
||||||
// set module frequency deviation to 0 if using FSK
|
// set module frequency deviation to 0 if using FSK
|
||||||
int16_t state = ERR_NONE;
|
int16_t state = ERR_NONE;
|
||||||
|
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||||
if(_audio == nullptr) {
|
if(_audio == nullptr) {
|
||||||
state = _phy->setFrequencyDeviation(0);
|
state = _phy->setFrequencyDeviation(0);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return(state);
|
return(state);
|
||||||
}
|
}
|
||||||
|
@ -298,19 +302,21 @@ size_t MorseClient::printFloat(double number, uint8_t digits) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t MorseClient::transmitDirect(uint32_t freq, uint32_t freqHz) {
|
int16_t MorseClient::transmitDirect(uint32_t freq, uint32_t freqHz) {
|
||||||
|
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||||
if(_audio != nullptr) {
|
if(_audio != nullptr) {
|
||||||
return(_audio->tone(freqHz));
|
return(_audio->tone(freqHz));
|
||||||
} else {
|
|
||||||
return(_phy->transmitDirect(freq));
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
return(_phy->transmitDirect(freq));
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t MorseClient::standby() {
|
int16_t MorseClient::standby() {
|
||||||
|
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||||
if(_audio != nullptr) {
|
if(_audio != nullptr) {
|
||||||
return(_audio->noTone());
|
return(_audio->noTone());
|
||||||
} else {
|
|
||||||
return(_phy->standby());
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
return(_phy->standby());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -157,8 +157,6 @@ class MorseClient {
|
||||||
PhysicalLayer* _phy;
|
PhysicalLayer* _phy;
|
||||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||||
AFSKClient* _audio;
|
AFSKClient* _audio;
|
||||||
#else
|
|
||||||
void* _audio;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint32_t _base = 0, _baseHz = 0;
|
uint32_t _base = 0, _baseHz = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue