Spectrum warp-around when switching steps

This commit is contained in:
Juan Antonio 2023-12-23 03:00:55 +01:00 committed by egzumer
parent bc9bb489e6
commit 34f2168856

View File

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