Skip to content

Commit 43f4790

Browse files
committed
BUG FIX #15: shifted numbers in spectrum freq input box
1 parent 43ccce3 commit 43f4790

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/spectrum.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,22 +561,22 @@ static void UpdateFreqInput(KEY_Code_t key) {
561561
for (int i = 0; i < 10; ++i) {
562562
if (i < freqInputIndex) {
563563
digitKey = freqInputArr[i];
564-
freqInputString[i] = digitKey <= KEY_9 ? '0' + digitKey : '.';
564+
freqInputString[i] = digitKey <= KEY_9 ? '0' + digitKey-KEY_0 : '.';
565565
} else {
566566
freqInputString[i] = '-';
567567
}
568568
}
569569

570570
uint32_t base = 100000; // 1MHz in BK units
571571
for (int i = dotIndex - 1; i >= 0; --i) {
572-
tempFreq += freqInputArr[i] * base;
572+
tempFreq += (freqInputArr[i]-KEY_0) * base;
573573
base *= 10;
574574
}
575575

576576
base = 10000; // 0.1MHz in BK units
577577
if (dotIndex < freqInputIndex) {
578578
for (int i = dotIndex + 1; i < freqInputIndex; ++i) {
579-
tempFreq += freqInputArr[i] * base;
579+
tempFreq += (freqInputArr[i]-KEY_0) * base;
580580
base /= 10;
581581
}
582582
}

0 commit comments

Comments
 (0)