[SSTV] Reworked driver exclusion

This commit is contained in:
jgromes 2020-06-30 10:46:04 +02:00
parent 80fa8ba99d
commit 10f11aac88
2 changed files with 12 additions and 1 deletions

View file

@ -1,4 +1,5 @@
#include "SSTV.h" #include "SSTV.h"
#if !defined(RADIOLIB_EXCLUDE_SSTV)
const SSTVMode_t Scottie1 { const SSTVMode_t Scottie1 {
.visCode = SSTV_SCOTTIE_1, .visCode = SSTV_SCOTTIE_1,
@ -158,10 +159,12 @@ SSTVClient::SSTVClient(PhysicalLayer* phy) {
_audio = nullptr; _audio = nullptr;
} }
#if !defined(RADIOLIB_EXCLUDE_AFSK)
SSTVClient::SSTVClient(AFSKClient* audio) { SSTVClient::SSTVClient(AFSKClient* audio) {
_phy = audio->_phy; _phy = audio->_phy;
_audio = audio; _audio = audio;
} }
#endif
int16_t SSTVClient::begin(SSTVMode_t mode, float correction) { int16_t SSTVClient::begin(SSTVMode_t mode, float correction) {
if(_audio == nullptr) { if(_audio == nullptr) {
@ -290,3 +293,5 @@ void SSTVClient::tone(float freq, uint32_t len) {
yield(); yield();
} }
} }
#endif

View file

@ -1,4 +1,4 @@
#ifndef _RADIOLIB_SSTV_H #if !defined(_RADIOLIB_SSTV_H) && !defined(RADIOLIB_EXCLUDE_SSTV)
#define _RADIOLIB_SSTV_H #define _RADIOLIB_SSTV_H
#include "../../TypeDef.h" #include "../../TypeDef.h"
@ -123,12 +123,14 @@ class SSTVClient {
*/ */
SSTVClient(PhysicalLayer* phy); SSTVClient(PhysicalLayer* phy);
#if !defined(RADIOLIB_EXCLUDE_AFSK)
/*! /*!
\brief Constructor for AFSK mode. \brief Constructor for AFSK mode.
\param audio Pointer to the AFSK instance providing audio. \param audio Pointer to the AFSK instance providing audio.
*/ */
SSTVClient(AFSKClient* phy); SSTVClient(AFSKClient* phy);
#endif
// basic methods // basic methods
@ -184,7 +186,11 @@ class SSTVClient {
private: private:
#endif #endif
PhysicalLayer* _phy; PhysicalLayer* _phy;
#if !defined(RADIOLIB_EXCLUDE_AFSK)
AFSKClient* _audio; AFSKClient* _audio;
#else
void* _audio;
#endif
uint32_t _base; uint32_t _base;
SSTVMode_t _mode; SSTVMode_t _mode;