[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) {
|
||||
_phy = phy;
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
_audio = nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
#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
|
||||
int16_t state = ERR_NONE;
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
if(_audio == nullptr) {
|
||||
state = _phy->setFrequencyDeviation(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
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) {
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
if(_audio != nullptr) {
|
||||
return(_audio->tone(freqHz));
|
||||
} else {
|
||||
return(_phy->transmitDirect(freq));
|
||||
}
|
||||
#endif
|
||||
return(_phy->transmitDirect(freq));
|
||||
}
|
||||
|
||||
int16_t MorseClient::standby() {
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
if(_audio != nullptr) {
|
||||
return(_audio->noTone());
|
||||
} else {
|
||||
return(_phy->standby());
|
||||
}
|
||||
#endif
|
||||
return(_phy->standby());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -157,8 +157,6 @@ class MorseClient {
|
|||
PhysicalLayer* _phy;
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
AFSKClient* _audio;
|
||||
#else
|
||||
void* _audio;
|
||||
#endif
|
||||
|
||||
uint32_t _base = 0, _baseHz = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue