mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 14:21:25 +03:00
AM fix rssi average with prev rssi
This commit is contained in:
parent
09bbec08cb
commit
97d6b69af9
24
am_fix.c
24
am_fix.c
@ -299,8 +299,8 @@ const uint8_t orig_pga = 6; // -3dB
|
|||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
unsigned int count;
|
uint16_t prev_level;
|
||||||
uint16_t level;
|
uint16_t level;
|
||||||
} rssi[2];
|
} rssi[2];
|
||||||
|
|
||||||
// to help reduce gain hunting, provides a peak hold time delay
|
// to help reduce gain hunting, provides a peak hold time delay
|
||||||
@ -312,8 +312,8 @@ const uint8_t orig_pga = 6; // -3dB
|
|||||||
void AM_fix_reset(const int vfo)
|
void AM_fix_reset(const int vfo)
|
||||||
{ // reset the AM fixer
|
{ // reset the AM fixer
|
||||||
|
|
||||||
rssi[vfo].count = 0;
|
rssi[vfo].prev_level = 0;
|
||||||
rssi[vfo].level = 0;
|
rssi[vfo].level = 0;
|
||||||
|
|
||||||
am_gain_hold_counter[vfo] = 0;
|
am_gain_hold_counter[vfo] = 0;
|
||||||
|
|
||||||
@ -362,20 +362,8 @@ const uint8_t orig_pga = 6; // -3dB
|
|||||||
}
|
}
|
||||||
|
|
||||||
// sample the current RSSI level, average it with the previous rssi
|
// sample the current RSSI level, average it with the previous rssi
|
||||||
#if 0
|
rssi[vfo].level = (rssi[vfo].prev_level + BK4819_GetRSSI()) >> 1;
|
||||||
if (rssi[vfo].count < 1)
|
rssi[vfo].prev_level = BK4819_GetRSSI();
|
||||||
{
|
|
||||||
rssi[vfo].level = BK4819_GetRSSI();
|
|
||||||
rssi[vfo].count++;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ // average of new and old RSSI's
|
|
||||||
rssi[vfo].level = (rssi[vfo].level + BK4819_GetRSSI()) >> 1;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
// no averaging with previous RSSI's
|
|
||||||
rssi[vfo].level = BK4819_GetRSSI();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef ENABLE_AM_FIX_TEST1
|
#ifdef ENABLE_AM_FIX_TEST1
|
||||||
|
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user