[Morse] Use out of band tone for space in AFSK mode (#529)

This commit is contained in:
jgromes 2022-05-28 17:57:42 +02:00
parent 206d49f802
commit 2faa4b5d71
3 changed files with 9 additions and 3 deletions

View file

@ -24,9 +24,13 @@ int16_t AFSKClient::tone(uint16_t freq, bool autoStart) {
return(RADIOLIB_ERR_NONE);
}
int16_t AFSKClient::noTone() {
int16_t AFSKClient::noTone(bool keepOn) {
Module* mod = _phy->getMod();
mod->noTone(_pin);
if(keepOn) {
return(0);
}
return(_phy->standby());
}

View file

@ -46,9 +46,11 @@ class AFSKClient {
/*!
\brief Stops transmitting audio tone.
\param freq Keep transmitter on - this may limit noise when switching transmitter on or off.
\returns \ref status_codes
*/
int16_t noTone();
int16_t noTone(bool keepOn = false);
#if !defined(RADIOLIB_GODMODE)
private:

View file

@ -308,7 +308,7 @@ int16_t MorseClient::transmitDirect(uint32_t freq, uint32_t freqHz) {
int16_t MorseClient::standby() {
#if !defined(RADIOLIB_EXCLUDE_AFSK)
if(_audio != nullptr) {
return(_audio->noTone());
return(_audio->noTone(true));
}
#endif
return(_phy->standby());