[FSK4] Reworked macro configuration system
This commit is contained in:
parent
f85abafe19
commit
71dbf371e7
2 changed files with 9 additions and 9 deletions
|
@ -1,15 +1,15 @@
|
||||||
#include "FSK4.h"
|
#include "FSK4.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#if !defined(RADIOLIB_EXCLUDE_FSK4)
|
#if !RADIOLIB_EXCLUDE_FSK4
|
||||||
|
|
||||||
FSK4Client::FSK4Client(PhysicalLayer* phy) {
|
FSK4Client::FSK4Client(PhysicalLayer* phy) {
|
||||||
phyLayer = phy;
|
phyLayer = phy;
|
||||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
#if !RADIOLIB_EXCLUDE_AFSK
|
||||||
audioClient = nullptr;
|
audioClient = nullptr;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(RADIOLIB_EXCLUDE_AFSK)
|
#if !RADIOLIB_EXCLUDE_AFSK
|
||||||
FSK4Client::FSK4Client(AFSKClient* audio) {
|
FSK4Client::FSK4Client(AFSKClient* audio) {
|
||||||
phyLayer = audio->phyLayer;
|
phyLayer = audio->phyLayer;
|
||||||
audioClient = audio;
|
audioClient = audio;
|
||||||
|
@ -87,7 +87,7 @@ void FSK4Client::tone(uint8_t i) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t FSK4Client::transmitDirect(uint32_t freq, uint32_t freqHz) {
|
int16_t FSK4Client::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));
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ int16_t FSK4Client::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_FSK4)
|
#if !RADIOLIB_EXCLUDE_FSK4
|
||||||
|
|
||||||
#include "../PhysicalLayer/PhysicalLayer.h"
|
#include "../PhysicalLayer/PhysicalLayer.h"
|
||||||
#include "../AFSK/AFSK.h"
|
#include "../AFSK/AFSK.h"
|
||||||
|
@ -20,7 +20,7 @@ class FSK4Client {
|
||||||
*/
|
*/
|
||||||
explicit FSK4Client(PhysicalLayer* phy);
|
explicit FSK4Client(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.
|
||||||
|
@ -74,11 +74,11 @@ class FSK4Client {
|
||||||
*/
|
*/
|
||||||
int16_t standby();
|
int16_t standby();
|
||||||
|
|
||||||
#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