diff --git a/app/app.c b/app/app.c index e95f6134..6bd889f0 100644 --- a/app/app.c +++ b/app/app.c @@ -386,9 +386,13 @@ void APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step) if (pInfo->StepFrequency == 833) { const uint32_t Lower = LowerLimitFrequencyBandTable[pInfo->Band]; const uint32_t Delta = Frequency - Lower; - const uint32_t Base = (Delta / 2500) * 2500; + uint32_t Base = (Delta / 2500) * 2500; const uint32_t Index = ((Delta - Base) % 2500) / 833; + if (Index == 2) { + Base++; + } + Frequency = Lower + Base + (Index * 833); } diff --git a/frequencies.c b/frequencies.c index 163412e1..274c5090 100644 --- a/frequencies.c +++ b/frequencies.c @@ -123,9 +123,13 @@ uint32_t FREQUENCY_FloorToStep(uint32_t Upper, uint32_t Step, uint32_t Lower) if (Step == 833) { const uint32_t Delta = Upper - Lower; - const uint32_t Base = (Delta / 2500) * 2500; + uint32_t Base = (Delta / 2500) * 2500; const uint32_t Index = ((Delta - Base) % 2500) / 833; + if (Index == 2) { + Base++; + } + return Lower + Base + (Index * 833); }