[Hell] Fixed exclusion macros
This commit is contained in:
parent
dc4c588bae
commit
e23f095585
2 changed files with 17 additions and 7 deletions
|
@ -3,7 +3,10 @@
|
|||
|
||||
HellClient::HellClient(PhysicalLayer* phy) {
|
||||
_phy = phy;
|
||||
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
_audio = nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
|
@ -23,9 +26,11 @@ int16_t HellClient::begin(float base, float rate) {
|
|||
|
||||
// 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);
|
||||
}
|
||||
|
@ -285,19 +290,21 @@ size_t HellClient::printFloat(double number, uint8_t digits) {
|
|||
}
|
||||
|
||||
int16_t HellClient::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 HellClient::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_HELLSCHREIBER_H) && !defined(RADIOLIB_EXCLUDE_HELLSCHREIBER)
|
||||
#if !defined(_RADIOLIB_HELLSCHREIBER_H)
|
||||
#define _RADIOLIB_HELLSCHREIBER_H
|
||||
|
||||
#include "../../TypeDef.h"
|
||||
|
||||
#if !defined(RADIOLIB_EXCLUDE_HELLSCHREIBER)
|
||||
|
||||
#include "../PhysicalLayer/PhysicalLayer.h"
|
||||
#include "../AFSK/AFSK.h"
|
||||
|
||||
|
@ -152,8 +155,6 @@ class HellClient {
|
|||
PhysicalLayer* _phy;
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
AFSKClient* _audio;
|
||||
#else
|
||||
void* _audio;
|
||||
#endif
|
||||
|
||||
uint32_t _base = 0, _baseHz = 0;
|
||||
|
@ -167,3 +168,5 @@ class HellClient {
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue