diff --git a/Makefile b/Makefile index ee4b5728e..cdd5b5b13 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ ENABLE_KEEP_MEM_NAME := 1 ENABLE_WIDE_RX := 1 ENABLE_TX_WHEN_AM := 0 ENABLE_F_CAL_MENU := 0 -ENABLE_CTCSS_TAIL_PHASE_SHIFT := 1 +ENABLE_CTCSS_TAIL_PHASE_SHIFT := 0 ENABLE_BOOT_BEEPS := 0 ENABLE_SHOW_CHARGE_LEVEL := 1 ENABLE_REVERSE_BAT_SYMBOL := 0 diff --git a/README.md b/README.md index 5e4bb1ba2..524110dcb 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ ENABLE_KEEP_MEM_NAME := 1 maintain channel name when (re)sav ENABLE_WIDE_RX := 1 full 18MHz to 1300MHz RX (though front-end/PA not designed for full range) ENABLE_TX_WHEN_AM := 0 allow TX (always FM) when RX is set to AM ENABLE_F_CAL_MENU := 0 enable the radios hidden frequency calibration menu -ENABLE_CTCSS_TAIL_PHASE_SHIFT := 0 standard CTCSS tail phase shift rather than QS's own 55Hz tone method +ENABLE_CTCSS_TAIL_PHASE_SHIFT := 0 standard CTCSS tail phase shift rather than QS's own 55Hz tone method, do not enable as it breaks STE functionality ENABLE_BOOT_BEEPS := 0 gives user audio feedback on volume knob position at boot-up ENABLE_SHOW_CHARGE_LEVEL := 1 show the charge level when the radio is on charge ENABLE_REVERSE_BAT_SYMBOL := 0 mirror the battery symbol on the status bar (+ pole on the right) diff --git a/app/app.c b/app/app.c index 1be572a57..a3465c919 100644 --- a/app/app.c +++ b/app/app.c @@ -485,12 +485,20 @@ void APP_StartListening(FUNCTION_Type_t Function, const bool reset_am_fix) #ifdef ENABLE_AM_FIX - BK4819_SetAGC(gRxVfo->Modulation != MODULATION_AM || !gSetting_AM_fix); + BK4819_SetAGC(!gSetting_AM_fix); - if (gRxVfo->Modulation == MODULATION_AM && gSetting_AM_fix) { // AM RX mode - if (reset_am_fix) - AM_fix_reset(chan); // TODO: only reset it when moving channel/frequency - AM_fix_10ms(chan); + if (gRxVfo->Modulation == MODULATION_AM) { // AM RX mode + if(gSetting_AM_fix) + { + if (reset_am_fix) + AM_fix_reset(chan); // TODO: only reset it when moving channel/frequency + AM_fix_10ms(chan); + } + else + { + // if not getting AM fix restore gain settings to sane values after AM fix has been turned off + BK4819_SetDefaultAmplifierSettings(); + } } else { // FM RX mode #ifndef ENABLE_ADJUSTABLE_RX_GAIN_SETTINGS diff --git a/driver/bk4819.c b/driver/bk4819.c index a95e0b5b5..e80be7db7 100644 --- a/driver/bk4819.c +++ b/driver/bk4819.c @@ -252,7 +252,7 @@ void BK4819_SetAGC(bool enable) // } // else { // BK4819_WriteRegister(BK4819_REG_7B, 0x318C); - + // BK4819_WriteRegister(BK4819_REG_7C, 0x595E); // BK4819_WriteRegister(BK4819_REG_20, 0x8DEF); @@ -310,7 +310,12 @@ void BK4819_InitAGC() BK4819_WriteRegister(BK4819_REG_11, 0x027B); // 0x027B / 000000 10 011 11 011 / -43dB BK4819_WriteRegister(BK4819_REG_10, 0x007A); // 0x007A / 000000 00 011 11 010 / -58dB BK4819_WriteRegister(BK4819_REG_14, 0x0019); // 0x0019 / 000000 00 000 11 001 / -79dB - BK4819_WriteRegister(BK4819_REG_49, (0 << 14) | (84 << 7) | (56 << 0)); //0x2A38 / 00 1010100 0111000 / 84, 56 + //30, 10 - doesn't overload but sound low + //50, 10 - best so far + //50, 15, - SOFT - signal doesn't fall too low - works best for now + //45, 25 - AGRESSIVE - lower histeresis, but volume jumps heavily, not good for music, might be good for aviation + //1 << 14 - way better, seems to open squelch and match squelch as opposed to 0 + BK4819_WriteRegister(BK4819_REG_49, (0b00 << 14) | (50 << 7) | (15 << 0)); //0x2A38 / 00 1010100 0111000 / 84, 56 BK4819_WriteRegister(BK4819_REG_7B, 0x8420); }