mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-06-19 06:39:49 +03:00
F+4 freq scan rounded to nearest step multiple
This commit is contained in:
12
app/app.c
12
app/app.c
@ -1568,9 +1568,17 @@ void APP_TimeSlice10ms(void)
|
||||
if (!BK4819_GetFrequencyScanResult(&Result))
|
||||
break;
|
||||
|
||||
Delta = Result - gScanFrequency;
|
||||
gScanFrequency = Result;
|
||||
Delta = Result - gScanFrequency;
|
||||
|
||||
#if 0
|
||||
gScanFrequency = Result;
|
||||
#else
|
||||
{
|
||||
const uint32_t step = StepFrequencyTable[gStepSetting];
|
||||
gScanFrequency = ((Result + (step / 2)) / step) * step; // round to nearest step multiple
|
||||
}
|
||||
#endif
|
||||
|
||||
if (Delta < 0)
|
||||
Delta = -Delta;
|
||||
if (Delta < 100)
|
||||
|
Reference in New Issue
Block a user