From 4d8abbff237be8aac3ff8a1edb284d83190cb0b5 Mon Sep 17 00:00:00 2001 From: T1MOXA Date: Mon, 29 Jan 2024 21:36:44 +0200 Subject: [PATCH] Fixes #106 --- app/app.c | 10 +++++----- app/app.h | 2 +- app/generic.c | 2 +- app/messenger.c | 2 +- radio.c | 14 ++++++++------ radio.h | 2 +- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/app/app.c b/app/app.c index a8d8466be..a99a56b98 100644 --- a/app/app.c +++ b/app/app.c @@ -727,9 +727,9 @@ static void CheckRadioInterrupts(void) } } -void APP_EndTransmission(void) +void APP_EndTransmission(bool isMessengerPacket) { // back to RX mode - RADIO_SendEndOfTransmission(); + RADIO_SendEndOfTransmission(isMessengerPacket); // send the CTCSS/DCS tail tone - allows the receivers to mute the usual FM squelch tail/crash RADIO_EnableCxCSS(); RADIO_SetupRegisters(false); @@ -785,7 +785,7 @@ void APP_EndTransmission(void) } else { - APP_EndTransmission(); + APP_EndTransmission(false); if (gEeprom.REPEATER_TAIL_TONE_ELIMINATION == 0) { @@ -836,7 +836,7 @@ void APP_Update(void) gTxTimeoutReached = false; gFlagEndTransmission = true; - APP_EndTransmission(); + APP_EndTransmission(false); AUDIO_PlayBeep(BEEP_880HZ_60MS_TRIPLE_BEEP); @@ -1599,7 +1599,7 @@ void APP_TimeSlice500ms(void) if (gEeprom.ALARM_MODE == ALARM_MODE_TONE) { - RADIO_SendEndOfTransmission(); + RADIO_SendEndOfTransmission(false); RADIO_EnableCxCSS(); } diff --git a/app/app.h b/app/app.h index 3c262ff73..0686e696d 100644 --- a/app/app.h +++ b/app/app.h @@ -27,7 +27,7 @@ extern bool gPlayMSGRing; #endif -void APP_EndTransmission(void); +void APP_EndTransmission(bool isMessengerPacket); void APP_StartListening(FUNCTION_Type_t Function); uint32_t APP_SetFreqByStepAndLimits(VFO_Info_t *pInfo, int8_t direction, uint32_t lower, uint32_t upper); uint32_t APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t direction); diff --git a/app/generic.c b/app/generic.c index 13ba098b9..8aa028212 100644 --- a/app/generic.c +++ b/app/generic.c @@ -107,7 +107,7 @@ void GENERIC_Key_PTT(bool bKeyPressed) } else { - APP_EndTransmission(); + APP_EndTransmission(false); if (gEeprom.REPEATER_TAIL_TONE_ELIMINATION == 0) FUNCTION_Select(FUNCTION_FOREGROUND); diff --git a/app/messenger.c b/app/messenger.c index 73669dbcf..55cce8ee6 100644 --- a/app/messenger.c +++ b/app/messenger.c @@ -598,7 +598,7 @@ void MSG_SendPacket(union DataPacket packet) { SYSTEM_DelayMs(100); - APP_EndTransmission(); + APP_EndTransmission(true); // this must be run after end of TX, otherwise radio will still TX transmit without even RED LED on FUNCTION_Select(FUNCTION_FOREGROUND); diff --git a/radio.c b/radio.c index fd9b6c2ae..282d98ce6 100644 --- a/radio.c +++ b/radio.c @@ -1064,13 +1064,15 @@ void RADIO_PrepareCssTX(void) RADIO_SetupRegisters(true); } -void RADIO_SendEndOfTransmission(void) +void RADIO_SendEndOfTransmission(bool isMessengerPacket) { - if (gEeprom.ROGER == ROGER_MODE_ROGER) - BK4819_PlayRoger(); - else - if (gEeprom.ROGER == ROGER_MODE_MDC) - BK4819_PlayRogerMDC(); + if (!isMessengerPacket) { + if (gEeprom.ROGER == ROGER_MODE_ROGER) + BK4819_PlayRoger(); + else + if (gEeprom.ROGER == ROGER_MODE_MDC) + BK4819_PlayRogerMDC(); + } if (gCurrentVfo->DTMF_PTT_ID_TX_MODE == PTT_ID_APOLLO) BK4819_PlaySingleTone(2475, 250, 28, gEeprom.DTMF_SIDE_TONE); diff --git a/radio.h b/radio.h index cc3282bc2..e2861138a 100644 --- a/radio.h +++ b/radio.h @@ -169,7 +169,7 @@ void RADIO_SetVfoState(VfoState_t State); void RADIO_PrepareTX(void); void RADIO_EnableCxCSS(void); void RADIO_PrepareCssTX(void); -void RADIO_SendEndOfTransmission(void); +void RADIO_SendEndOfTransmission(bool isMessengerPacket); #endif #ifdef ENABLE_SPECTRUM_CHANNEL_SCAN