[SSTV] Fixed exclusion macros
This commit is contained in:
parent
dabac56cc4
commit
a5db0c02bf
2 changed files with 18 additions and 3 deletions
|
@ -156,7 +156,9 @@ const SSTVMode_t PasokonP7 {
|
|||
|
||||
SSTVClient::SSTVClient(PhysicalLayer* phy) {
|
||||
_phy = phy;
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
_audio = nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
|
@ -166,6 +168,7 @@ SSTVClient::SSTVClient(AFSKClient* audio) {
|
|||
}
|
||||
#endif
|
||||
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
int16_t SSTVClient::begin(const SSTVMode_t& mode, float correction) {
|
||||
if(_audio == nullptr) {
|
||||
// this initialization method can only be used in AFSK mode
|
||||
|
@ -174,6 +177,7 @@ int16_t SSTVClient::begin(const SSTVMode_t& mode, float correction) {
|
|||
|
||||
return(begin(0, mode, correction));
|
||||
}
|
||||
#endif
|
||||
|
||||
int16_t SSTVClient::begin(float base, const SSTVMode_t& mode, float correction) {
|
||||
// save mode
|
||||
|
@ -190,9 +194,11 @@ int16_t SSTVClient::begin(float base, const SSTVMode_t& mode, float correction)
|
|||
|
||||
// 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);
|
||||
}
|
||||
|
@ -284,11 +290,15 @@ uint16_t SSTVClient::getPictureHeight() const {
|
|||
|
||||
void SSTVClient::tone(float freq, uint32_t len) {
|
||||
uint32_t start = micros();
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
if(_audio != nullptr) {
|
||||
_audio->tone(freq, false);
|
||||
} else {
|
||||
_phy->transmitDirect(_base + (freq / _phy->getFreqStep()));
|
||||
}
|
||||
#else
|
||||
_phy->transmitDirect(_base + (freq / _phy->getFreqStep()));
|
||||
#endif
|
||||
while(micros() - start < len) {
|
||||
yield();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
#if !defined(_RADIOLIB_SSTV_H) && !defined(RADIOLIB_EXCLUDE_SSTV)
|
||||
#if !defined(_RADIOLIB_SSTV_H)
|
||||
#define _RADIOLIB_SSTV_H
|
||||
|
||||
#include "../../TypeDef.h"
|
||||
|
||||
#if !defined(RADIOLIB_EXCLUDE_SSTV)
|
||||
|
||||
#include "../PhysicalLayer/PhysicalLayer.h"
|
||||
#include "../AFSK/AFSK.h"
|
||||
|
||||
|
@ -147,6 +150,7 @@ class SSTVClient {
|
|||
*/
|
||||
int16_t begin(float base, const SSTVMode_t& mode, float correction = 1.0);
|
||||
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
/*!
|
||||
\brief Initialization method for AFSK.
|
||||
|
||||
|
@ -157,6 +161,7 @@ class SSTVClient {
|
|||
\returns \ref status_codes
|
||||
*/
|
||||
int16_t begin(const SSTVMode_t& mode, float correction = 1.0);
|
||||
#endif
|
||||
|
||||
/*!
|
||||
\brief Sends out tone at 1900 Hz.
|
||||
|
@ -188,8 +193,6 @@ class SSTVClient {
|
|||
PhysicalLayer* _phy;
|
||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
||||
AFSKClient* _audio;
|
||||
#else
|
||||
void* _audio;
|
||||
#endif
|
||||
|
||||
uint32_t _base = 0;
|
||||
|
@ -200,3 +203,5 @@ class SSTVClient {
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue