[RTTY] Reworked macro configuration system
This commit is contained in:
parent
e6a6923b25
commit
eddde76371
2 changed files with 9 additions and 9 deletions
|
@ -2,17 +2,17 @@
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#if !defined(RADIOLIB_EXCLUDE_RTTY)
|
#if !RADIOLIB_EXCLUDE_RTTY
|
||||||
|
|
||||||
RTTYClient::RTTYClient(PhysicalLayer* phy) {
|
RTTYClient::RTTYClient(PhysicalLayer* phy) {
|
||||||
phyLayer = phy;
|
phyLayer = phy;
|
||||||
lineFeed = "\r\n";
|
lineFeed = "\r\n";
|
||||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
#if !RADIOLIB_EXCLUDE_AFSK
|
||||||
audioClient = nullptr;
|
audioClient = nullptr;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
#if !RADIOLIB_EXCLUDE_AFSK
|
||||||
RTTYClient::RTTYClient(AFSKClient* audio) {
|
RTTYClient::RTTYClient(AFSKClient* audio) {
|
||||||
phyLayer = audio->phyLayer;
|
phyLayer = audio->phyLayer;
|
||||||
lineFeed = "\r\n";
|
lineFeed = "\r\n";
|
||||||
|
@ -104,7 +104,7 @@ void RTTYClient::space() {
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t RTTYClient::transmitDirect(uint32_t freq, uint32_t freqHz) {
|
int16_t RTTYClient::transmitDirect(uint32_t freq, uint32_t freqHz) {
|
||||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
#if !RADIOLIB_EXCLUDE_AFSK
|
||||||
if(audioClient != nullptr) {
|
if(audioClient != nullptr) {
|
||||||
return(audioClient->tone(freqHz));
|
return(audioClient->tone(freqHz));
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ int16_t RTTYClient::standby() {
|
||||||
// ensure everything is stopped in interrupt timing mode
|
// ensure everything is stopped in interrupt timing mode
|
||||||
Module* mod = phyLayer->getMod();
|
Module* mod = phyLayer->getMod();
|
||||||
mod->waitForMicroseconds(0, 0);
|
mod->waitForMicroseconds(0, 0);
|
||||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
#if !RADIOLIB_EXCLUDE_AFSK
|
||||||
if(audioClient != nullptr) {
|
if(audioClient != nullptr) {
|
||||||
return(audioClient->noTone());
|
return(audioClient->noTone());
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include "../../TypeDef.h"
|
#include "../../TypeDef.h"
|
||||||
|
|
||||||
#if !defined(RADIOLIB_EXCLUDE_RTTY)
|
#if !RADIOLIB_EXCLUDE_RTTY
|
||||||
|
|
||||||
#include "../PhysicalLayer/PhysicalLayer.h"
|
#include "../PhysicalLayer/PhysicalLayer.h"
|
||||||
#include "../AFSK/AFSK.h"
|
#include "../AFSK/AFSK.h"
|
||||||
|
@ -22,7 +22,7 @@ class RTTYClient: public RadioLibPrint {
|
||||||
*/
|
*/
|
||||||
explicit RTTYClient(PhysicalLayer* phy);
|
explicit RTTYClient(PhysicalLayer* phy);
|
||||||
|
|
||||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
#if !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.
|
||||||
|
@ -61,11 +61,11 @@ class RTTYClient: public RadioLibPrint {
|
||||||
*/
|
*/
|
||||||
size_t write(uint8_t b);
|
size_t write(uint8_t b);
|
||||||
|
|
||||||
#if !defined(RADIOLIB_GODMODE)
|
#if !RADIOLIB_GODMODE
|
||||||
private:
|
private:
|
||||||
#endif
|
#endif
|
||||||
PhysicalLayer* phyLayer;
|
PhysicalLayer* phyLayer;
|
||||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
#if !RADIOLIB_EXCLUDE_AFSK
|
||||||
AFSKClient* audioClient;
|
AFSKClient* audioClient;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue