[Hell] Reworked driver exclusion

This commit is contained in:
jgromes 2020-06-30 10:45:28 +02:00
parent fc21a1d501
commit d032015e31
2 changed files with 12 additions and 1 deletions

View file

@ -1,14 +1,17 @@
#include "Hellschreiber.h"
#if !defined(RADIOLIB_EXCLUDE_HELLSCHREIBER)
HellClient::HellClient(PhysicalLayer* phy) {
_phy = phy;
_audio = nullptr;
}
#if !defined(RADIOLIB_EXCLUDE_AFSK)
HellClient::HellClient(AFSKClient* audio) {
_phy = audio->_phy;
_audio = audio;
}
#endif
int16_t HellClient::begin(float base, float rate) {
// calculate 24-bit frequency
@ -295,3 +298,5 @@ int16_t HellClient::standby() {
return(_phy->standby());
}
}
#endif

View file

@ -1,4 +1,4 @@
#ifndef _RADIOLIB_HELLSCHREIBER_H
#if !defined(_RADIOLIB_HELLSCHREIBER_H) && !defined(RADIOLIB_EXCLUDE_HELLSCHREIBER)
#define _RADIOLIB_HELLSCHREIBER_H
#include "../../TypeDef.h"
@ -92,12 +92,14 @@ class HellClient {
*/
HellClient(PhysicalLayer* phy);
#if !defined(RADIOLIB_EXCLUDE_AFSK)
/*!
\brief Constructor for AFSK mode.
\param audio Pointer to the AFSK instance providing audio.
*/
HellClient(AFSKClient* audio);
#endif
// basic methods
@ -148,7 +150,11 @@ class HellClient {
private:
#endif
PhysicalLayer* _phy;
#if !defined(RADIOLIB_EXCLUDE_AFSK)
AFSKClient* _audio;
#else
void* _audio;
#endif
uint32_t _base, _baseHz;
uint32_t _pixelDuration;