From 34f2168856e620a938c067deafe7f2ba08cd2fb3 Mon Sep 17 00:00:00 2001 From: Juan Antonio Date: Sat, 23 Dec 2023 03:00:55 +0100 Subject: [PATCH] Spectrum warp-around when switching steps --- app/spectrum.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/spectrum.c b/app/spectrum.c index 03f3c9b94..2ab22c105 100644 --- a/app/spectrum.c +++ b/app/spectrum.c @@ -488,12 +488,10 @@ static void UpdateDBMax(bool inc) { } static void UpdateScanStep(bool inc) { - if (inc && settings.scanStepIndex < S_STEP_100_0kHz) { - settings.scanStepIndex++; - } else if (!inc && settings.scanStepIndex > 0) { - settings.scanStepIndex--; + if (inc) { + settings.scanStepIndex = settings.scanStepIndex != S_STEP_100_0kHz ? settings.scanStepIndex + 1 : 0; } else { - return; + settings.scanStepIndex = settings.scanStepIndex != 0 ? settings.scanStepIndex - 1 : S_STEP_100_0kHz; } settings.frequencyChangeStep = GetBW() >> 1;