diff --git a/app/app.c b/app/app.c index c691ab1..90600e7 100644 --- a/app/app.c +++ b/app/app.c @@ -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) #ifdef ENABLE_VOICE -// if (gVoiceWriteIndex == 0) + if (gVoiceWriteIndex == 0) // AM/FM RX mode will be set when the voice has finished #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); @@ -1023,7 +1023,7 @@ void APP_Update(void) } #endif - if ((gCurrentFunction == FUNCTION_TRANSMIT && gTxTimeoutReached) || gSerialConfigCountDown_500ms > 0) + if (gCurrentFunction == FUNCTION_TRANSMIT && (gTxTimeoutReached || gSerialConfigCountDown_500ms > 0)) { // transmitter timed out or must de-key gTxTimeoutReached = false; @@ -1390,7 +1390,8 @@ void APP_TimeSlice10ms(void) #endif #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); #endif diff --git a/audio.c b/audio.c index eff3393..6f19c65 100644 --- a/audio.c +++ b/audio.c @@ -258,7 +258,9 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep) 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); #ifdef ENABLE_FMRADIO @@ -278,7 +280,9 @@ void AUDIO_PlayBeep(BEEP_Type_t Beep) { 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); #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); #ifdef ENABLE_FMRADIO diff --git a/driver/bk4819.c b/driver/bk4819.c index 551de68..255a83b 100644 --- a/driver/bk4819.c +++ b/driver/bk4819.c @@ -854,13 +854,14 @@ void BK4819_SetCompander(const unsigned int mode) // // 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_0dB = 86; -// const uint16_t compress_noise_dB = 64; -// BK4819_WriteRegister(BK4819_REG_29, // (BK4819_ReadRegister(BK4819_REG_29) & ~(3u < 14)) | (compress_ratio < 14)); -// (compress_ratio < 14) -// | (compress_0dB < 7) -// | (compress_noise_dB < 0)); + const uint16_t compress_ratio = (mode == 1 || mode >= 3) ? 2 : 0; // 2:1 + const uint16_t compress_0dB = 86; + const uint16_t compress_noise_dB = 64; +// AB40 10 1010110 1000000 + BK4819_WriteRegister(BK4819_REG_29, // (BK4819_ReadRegister(BK4819_REG_29) & ~(3u < 14)) | (compress_ratio < 14)); + (compress_ratio < 14) + | (compress_0dB < 7) + | (compress_noise_dB < 0)); // 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) // -// const uint16_t expand_ratio = (mode >= 2) ? 1 : 0; // 1:2 -// const uint16_t expand_0dB = 86; -// const uint16_t expand_noise_dB = 56; -// BK4819_WriteRegister(BK4819_REG_28, // (BK4819_ReadRegister(BK4819_REG_28) & ~(3u < 14)) | (expand_ratio < 14)); -// (expand_ratio < 14) -// | (expand_0dB < 7) -// | (expand_noise_dB < 0)); + const uint16_t expand_ratio = (mode >= 2) ? 1 : 0; // 1:2 + const uint16_t expand_0dB = 86; + const uint16_t expand_noise_dB = 56; +// 6B38 01 1010110 0111000 + BK4819_WriteRegister(BK4819_REG_28, // (BK4819_ReadRegister(BK4819_REG_28) & ~(3u < 14)) | (expand_ratio < 14)); + (expand_ratio < 14) + | (expand_0dB < 7) + | (expand_noise_dB < 0)); } void BK4819_DisableVox(void) diff --git a/firmware.bin b/firmware.bin index 01a16ca..76de68c 100644 Binary files a/firmware.bin and b/firmware.bin differ diff --git a/firmware.packed.bin b/firmware.packed.bin index 1541aad..5b41567 100644 Binary files a/firmware.packed.bin and b/firmware.packed.bin differ diff --git a/utils/misc.exe b/utils/misc.exe index e43b070..ba79991 100644 Binary files a/utils/misc.exe and b/utils/misc.exe differ