0
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:
OneOfEleven
2023-10-07 11:20:36 +01:00
parent 5ac08023b3
commit f93f3659f9
4 changed files with 24 additions and 9 deletions

View File

@ -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)