Skip to content

Commit

Permalink
spectrum 8.33k steps fix
Browse files Browse the repository at this point in the history
  • Loading branch information
prokrypt committed Jul 2, 2024
1 parent 1c55362 commit c776c47
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions app/spectrum.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,14 @@ uint16_t GetStepsCount()
return (128 >> settings.stepsCount);
}

uint32_t GetBW() { return GetStepsCount() * GetScanStep(); }
uint32_t GetBW()
{
if(GetScanStep()==833)
return (GetStepsCount()*833333)/1000;
else
return GetStepsCount() * GetScanStep();
}

uint32_t GetFStart() {
return IsCenterMode() ? currentFreq - (GetBW() >> 1) : currentFreq;
}
Expand Down Expand Up @@ -514,9 +521,9 @@ static void UpdateScanStep(bool inc) {

static void UpdateCurrentFreq(bool inc) {
if (inc && currentFreq < F_MAX) {
currentFreq += settings.frequencyChangeStep;
currentFreq = FREQUENCY_RoundToStep(currentFreq + settings.frequencyChangeStep, scanStepValues[settings.scanStepIndex]);
} else if (!inc && currentFreq > F_MIN) {
currentFreq -= settings.frequencyChangeStep;
currentFreq = FREQUENCY_RoundToStep(currentFreq - settings.frequencyChangeStep, scanStepValues[settings.scanStepIndex]);
} else {
return;
}
Expand Down

0 comments on commit c776c47

Please sign in to comment.