0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 14:48:03 +03:00

serial comms TX lockout bug fix

This commit is contained in:
OneOfEleven
2023-10-03 19:19:40 +01:00
parent f8aaf47374
commit 4b17aa6d3f
6 changed files with 30 additions and 21 deletions

View File

@ -574,9 +574,9 @@ void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix)
(gEeprom.DAC_GAIN << 0)); // AF DAC Gain (after Gain-1 and Gain-2) (gEeprom.DAC_GAIN << 0)); // AF DAC Gain (after Gain-1 and Gain-2)
#ifdef ENABLE_VOICE #ifdef ENABLE_VOICE
// if (gVoiceWriteIndex == 0) if (gVoiceWriteIndex == 0) // AM/FM RX mode will be set when the voice has finished
#endif #endif
BK4819_SetAF(gRxVfo->AM_mode ? BK4819_AF_AM : BK4819_AF_OPEN); BK4819_SetAF(gRxVfo->AM_mode ? BK4819_AF_AM : BK4819_AF_OPEN); // no need, set it now
FUNCTION_Select(Function); FUNCTION_Select(Function);
@ -1023,7 +1023,7 @@ void APP_Update(void)
} }
#endif #endif
if ((gCurrentFunction == FUNCTION_TRANSMIT && gTxTimeoutReached) || gSerialConfigCountDown_500ms > 0) if (gCurrentFunction == FUNCTION_TRANSMIT && (gTxTimeoutReached || gSerialConfigCountDown_500ms > 0))
{ // transmitter timed out or must de-key { // transmitter timed out or must de-key
gTxTimeoutReached = false; gTxTimeoutReached = false;
@ -1390,7 +1390,8 @@ void APP_TimeSlice10ms(void)
#endif #endif
#ifdef ENABLE_AM_FIX #ifdef ENABLE_AM_FIX
if (gEeprom.VfoInfo[gEeprom.RX_CHANNEL].AM_mode && gSetting_AM_fix) // if (gEeprom.VfoInfo[gEeprom.RX_CHANNEL].AM_mode && gSetting_AM_fix)
if (gRxVfo->AM_mode && gSetting_AM_fix)
AM_fix_10ms(gEeprom.RX_CHANNEL); AM_fix_10ms(gEeprom.RX_CHANNEL);
#endif #endif

12
audio.c
View File

@ -258,7 +258,9 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep)
VoiceID += VOICE_ID_ENG_BASE; VoiceID += VOICE_ID_ENG_BASE;
} }
if (gCurrentFunction == FUNCTION_RECEIVE || gCurrentFunction == FUNCTION_MONITOR) if (gCurrentFunction == FUNCTION_RECEIVE ||
gCurrentFunction == FUNCTION_MONITOR ||
gCurrentFunction == FUNCTION_INCOMING) // 1of11
BK4819_SetAF(BK4819_AF_MUTE); BK4819_SetAF(BK4819_AF_MUTE);
#ifdef ENABLE_FMRADIO #ifdef ENABLE_FMRADIO
@ -278,7 +280,9 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep)
{ {
SYSTEM_DelayMs(Delay * 10); SYSTEM_DelayMs(Delay * 10);
if (gCurrentFunction == FUNCTION_RECEIVE || gCurrentFunction == FUNCTION_MONITOR) if (gCurrentFunction == FUNCTION_RECEIVE ||
gCurrentFunction == FUNCTION_MONITOR ||
gCurrentFunction == FUNCTION_INCOMING) // 1of11
BK4819_SetAF(gRxVfo->AM_mode ? BK4819_AF_AM : BK4819_AF_OPEN); BK4819_SetAF(gRxVfo->AM_mode ? BK4819_AF_AM : BK4819_AF_OPEN);
#ifdef ENABLE_FMRADIO #ifdef ENABLE_FMRADIO
@ -410,7 +414,9 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep)
} }
} }
if (gCurrentFunction == FUNCTION_RECEIVE || gCurrentFunction == FUNCTION_MONITOR) if (gCurrentFunction == FUNCTION_RECEIVE ||
gCurrentFunction == FUNCTION_MONITOR ||
gCurrentFunction == FUNCTION_INCOMING) // 1of11
BK4819_SetAF(gRxVfo->AM_mode ? BK4819_AF_AM : BK4819_AF_OPEN); BK4819_SetAF(gRxVfo->AM_mode ? BK4819_AF_AM : BK4819_AF_OPEN);
#ifdef ENABLE_FMRADIO #ifdef ENABLE_FMRADIO

View File

@ -854,13 +854,14 @@ void BK4819_SetCompander(const unsigned int mode)
// //
// REG_29 <6:0> 64 Compress (AF Tx) noise point (dB) // REG_29 <6:0> 64 Compress (AF Tx) noise point (dB)
// //
// const uint16_t compress_ratio = (mode == 1 || mode >= 3) ? 2 : 0; // 2:1 const uint16_t compress_ratio = (mode == 1 || mode >= 3) ? 2 : 0; // 2:1
// const uint16_t compress_0dB = 86; const uint16_t compress_0dB = 86;
// const uint16_t compress_noise_dB = 64; const uint16_t compress_noise_dB = 64;
// BK4819_WriteRegister(BK4819_REG_29, // (BK4819_ReadRegister(BK4819_REG_29) & ~(3u < 14)) | (compress_ratio < 14)); // AB40 10 1010110 1000000
// (compress_ratio < 14) BK4819_WriteRegister(BK4819_REG_29, // (BK4819_ReadRegister(BK4819_REG_29) & ~(3u < 14)) | (compress_ratio < 14));
// | (compress_0dB < 7) (compress_ratio < 14)
// | (compress_noise_dB < 0)); | (compress_0dB < 7)
| (compress_noise_dB < 0));
// set the expander ratio // set the expander ratio
// //
@ -874,13 +875,14 @@ void BK4819_SetCompander(const unsigned int mode)
// //
// REG_28 <6:0> 56 Expander (AF Rx) noise point (dB) // REG_28 <6:0> 56 Expander (AF Rx) noise point (dB)
// //
// const uint16_t expand_ratio = (mode >= 2) ? 1 : 0; // 1:2 const uint16_t expand_ratio = (mode >= 2) ? 1 : 0; // 1:2
// const uint16_t expand_0dB = 86; const uint16_t expand_0dB = 86;
// const uint16_t expand_noise_dB = 56; const uint16_t expand_noise_dB = 56;
// BK4819_WriteRegister(BK4819_REG_28, // (BK4819_ReadRegister(BK4819_REG_28) & ~(3u < 14)) | (expand_ratio < 14)); // 6B38 01 1010110 0111000
// (expand_ratio < 14) BK4819_WriteRegister(BK4819_REG_28, // (BK4819_ReadRegister(BK4819_REG_28) & ~(3u < 14)) | (expand_ratio < 14));
// | (expand_0dB < 7) (expand_ratio < 14)
// | (expand_noise_dB < 0)); | (expand_0dB < 7)
| (expand_noise_dB < 0));
} }
void BK4819_DisableVox(void) void BK4819_DisableVox(void)

Binary file not shown.

Binary file not shown.

Binary file not shown.