0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-30 07:11:26 +03:00

AM fix update

This commit is contained in:
OneOfEleven 2023-09-22 14:18:41 +01:00
parent 17158231fb
commit 7a58dbc0cb
4 changed files with 9 additions and 8 deletions

View File

@ -1400,8 +1400,8 @@ void APP_CheckKeys(void)
// 1 = -27dB // 1 = -27dB
// 0 = -33dB // 0 = -33dB
// -90dBm, any higher and the AM demodulator starts to saturate/clip (distort) // -87dBm, any higher and the AM demodulator starts to saturate/clip (distort)
const uint16_t desired_rssi = (-90 + 160) * 2; // dBm to ADC sample const uint16_t desired_rssi = (-87 + 160) * 2; // dBm to ADC sample
// start with current settings // start with current settings
register uint16_t new_lna_short = am_lna_short; register uint16_t new_lna_short = am_lna_short;
@ -1424,7 +1424,8 @@ void APP_CheckKeys(void)
} }
else else
{ {
max_lna = 5; // max_lna = 4;
max_lna = 7;
max_pga = 7; max_pga = 7;
} }
@ -1447,21 +1448,21 @@ void APP_CheckKeys(void)
if (rssi > desired_rssi) if (rssi > desired_rssi)
{ // decrease gain { // decrease gain
if (new_lna > orig_lna)
new_lna--;
else
if (new_pga > orig_pga) if (new_pga > orig_pga)
new_pga--; new_pga--;
else else
if (new_mixer > orig_mixer) if (new_mixer > orig_mixer)
new_mixer--; new_mixer--;
else else
if (new_lna > orig_lna) if (new_lna > 0)
new_lna--; new_lna--;
else else
if (new_pga > 0) if (new_pga > 0)
new_pga--; new_pga--;
else else
if (new_lna > 0)
new_lna--;
else
if (new_mixer > 0) if (new_mixer > 0)
new_mixer--; new_mixer--;
// else // else
@ -1477,7 +1478,7 @@ void APP_CheckKeys(void)
if (am_fix_increase_counter == 0) if (am_fix_increase_counter == 0)
{ // increase gain { // increase gain
if (rssi < (desired_rssi - 7)) if (rssi < (desired_rssi - 10))
{ // increase gain { // increase gain
if (new_pga < max_pga) if (new_pga < max_pga)
{ {

BIN
firmware

Binary file not shown.

Binary file not shown.

Binary file not shown.