Skip to content

Commit

Permalink
Merge pull request #43 from kamilsss655/rc16.6
Browse files Browse the repository at this point in the history
Rc16.6
  • Loading branch information
kamilsss655 committed Jan 6, 2024
2 parents eb784cd + 22cb168 commit eb72f4b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
18 changes: 13 additions & 5 deletions app/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions driver/bk4819.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

}
Expand Down

0 comments on commit eb72f4b

Please sign in to comment.