Fix FM, NFM, NFM+ (an AM ready)

This commit is contained in:
Armel FAUVEAU
2024-10-20 22:55:17 +02:00
parent 2ea71b936d
commit c94ea17943

View File

@@ -613,51 +613,49 @@ void BK4819_SetFilterBandwidth(const BK4819_FilterBandwidth_t Bandwidth, const b
{
default:
case BK4819_FILTER_BW_WIDE: // 25kHz
val = (4u << 12) | // *3 RF filter bandwidth
(6u << 6) | // *0 AFTxLPF2 filter Band Width
(2u << 4) | // 2 BW Mode Selection
(1u << 3) | // 1
(0u << 2); // 0 Gain after FM Demodulation
if (weak_no_different) {
// make the RX bandwidth the same with weak signals
val |= (4u << 9); // *0 RF filter bandwidth when signal is weak
val = 0x3628; // Old value 0x49a8 < v3.6
} else {
/// with weak RX signals the RX bandwidth is reduced
val |= (2u << 9); // *0 RF filter bandwidth when signal is weak
// with weak RX signals the RX bandwidth is reduced
val = 0x3428; // Old value 0x45a8 < v3.6
}
break;
case BK4819_FILTER_BW_NARROW: // 12.5kHz
val = (4u << 12) | // *4 RF filter bandwidth
(0u << 6) | // *1 AFTxLPF2 filter Band Width
(0u << 4) | // 0 BW Mode Selection
(1u << 3) | // 1
(0u << 2); // 0 Gain after FM Demodulation
if (weak_no_different) {
val |= (4u << 9); // *0 RF filter bandwidth when signal is weak
// make the RX bandwidth the same with weak signals
val = 0x3648; // Old value 0x4808 < v3.6
} else {
val |= (2u << 9);
// with weak RX signals the RX bandwidth is reduced
val = 0x3448; // Old value 0x4408 < v3.6
}
break;
case BK4819_FILTER_BW_NARROWER: // 6.25kHz
val = (3u << 12) | // 3 RF filter bandwidth
(3u << 9) | // *0 RF filter bandwidth when signal is weak
(1u << 6) | // 1 AFTxLPF2 filter Band Width
(1u << 4) | // 1 BW Mode Selection
(1u << 3) | // 1
(0u << 2); // 0 Gain after FM Demodulation
if (weak_no_different) {
val |= (3u << 9);
// make the RX bandwidth the same with weak signals
val = 0x1348; // Old value 0x3658 < v3.6
} else {
val |= (0u << 9); // 0 RF filter bandwidth when signal is weak
// with weak RX signals the RX bandwidth is reduced
val = 0x1148; // Old value 0x3658 < v3.6
}
break;
/*
case BK4819_FILTER_BW_AM: // 8.33kHz
if (weak_no_different) {
// make the RX bandwidth the same with weak signals
val = 0x4858;
} else {
// with weak RX signals the RX bandwidth is reduced
val = 0x4458;
}
break;
*/
}
BK4819_WriteRegister(BK4819_REG_43, val);