Fixed upper limit check.

This commit is contained in:
Dual Tachyon 2023-09-06 22:02:35 +01:00
parent 2f00d4802f
commit 159006fdf0

View File

@ -354,7 +354,7 @@ void APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step)
uint32_t Frequency;
Frequency = pInfo->ConfigRX.Frequency + (Step * pInfo->StepFrequency);
if (Frequency >= gUpperLimitFrequencyBandTable[pInfo->Band]) {
if (Frequency > gUpperLimitFrequencyBandTable[pInfo->Band]) {
pInfo->ConfigRX.Frequency = gLowerLimitFrequencyBandTable[pInfo->Band];
} else if (Frequency < gLowerLimitFrequencyBandTable[pInfo->Band]) {
pInfo->ConfigRX.Frequency = FREQUENCY_FloorToStep(gUpperLimitFrequencyBandTable[pInfo->Band], pInfo->StepFrequency, gLowerLimitFrequencyBandTable[pInfo->Band]);