mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-29 14:51:26 +03:00
AM fix update
This commit is contained in:
parent
1c5b2975db
commit
c5ca07e7e9
20
app/app.c
20
app/app.c
@ -1429,18 +1429,18 @@ void APP_CheckKeys(void)
|
|||||||
if (++moving_avg_rssi.index >= ARRAY_SIZE(moving_avg_rssi.samples)) // next buffer slot
|
if (++moving_avg_rssi.index >= ARRAY_SIZE(moving_avg_rssi.samples)) // next buffer slot
|
||||||
moving_avg_rssi.index = 0; // wrap-a-round
|
moving_avg_rssi.index = 0; // wrap-a-round
|
||||||
rssi = moving_avg_rssi.sum / moving_avg_rssi.count; // compute the average of the past 'n' samples
|
rssi = moving_avg_rssi.sum / moving_avg_rssi.count; // compute the average of the past 'n' samples
|
||||||
|
#if 1
|
||||||
if (rssi >= rssi_peak_hold_val)
|
if (rssi > rssi_peak_hold_val)
|
||||||
{ // enter hold mode (pause any gain increases)
|
{ // enter hold mode (pause any gain increases)
|
||||||
rssi_peak_hold_val = rssi;
|
rssi_peak_hold_val = rssi;
|
||||||
rssi_peak_hold_count = 50; // 500ms
|
rssi_peak_hold_count = 10; // 100ms
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (rssi_peak_hold_count > 0)
|
if (rssi_peak_hold_count > 0)
|
||||||
rssi_peak_hold_count--;
|
rssi_peak_hold_count--;
|
||||||
else
|
else
|
||||||
rssi_peak_hold_val = rssi;
|
rssi_peak_hold_val = rssi;
|
||||||
|
#endif
|
||||||
// the register adjustments below to be a bit more inteligent in order to obtain a consitant fine step size
|
// the register adjustments below to be a bit more inteligent in order to obtain a consitant fine step size
|
||||||
|
|
||||||
if (rssi > desired_rssi)
|
if (rssi > desired_rssi)
|
||||||
@ -1463,9 +1463,9 @@ void APP_CheckKeys(void)
|
|||||||
else
|
else
|
||||||
if (new_mixer > 0)
|
if (new_mixer > 0)
|
||||||
new_mixer--;
|
new_mixer--;
|
||||||
else
|
// else
|
||||||
if (new_lna_short > 0)
|
// if (new_lna_short > 0)
|
||||||
new_lna_short--;
|
// new_lna_short--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (moving_avg_rssi.index > 0)
|
if (moving_avg_rssi.index > 0)
|
||||||
@ -1483,9 +1483,9 @@ void APP_CheckKeys(void)
|
|||||||
else
|
else
|
||||||
if (new_lna < 7)
|
if (new_lna < 7)
|
||||||
new_lna++;
|
new_lna++;
|
||||||
else
|
// else
|
||||||
if (new_lna_short < 3)
|
// if (new_lna_short < 3)
|
||||||
new_lna_short++;
|
// new_lna_short++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user