Better fix for the spectrum analyser

This commit is contained in:
Bertrand Songis
2019-04-29 12:01:38 +02:00
parent bcbc8c6206
commit 957b6ed5e3
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1202,7 +1202,7 @@ union ReusableBuffer
struct
{
int8_t bars[LCD_W];
uint8_t bars[LCD_W];
uint32_t freq;
uint32_t span;
uint32_t step;
+1 -1
View File
@@ -220,7 +220,7 @@ void processSpectrumAnalyserFrame(uint8_t module, uint8_t * frame)
int32_t position = *frequency - (reusableBuffer.spectrumAnalyser.freq - reusableBuffer.spectrumAnalyser.span / 2);
uint32_t x = (position * LCD_W / 8) / (reusableBuffer.spectrumAnalyser.span / 8);
if (x < LCD_W) {
reusableBuffer.spectrumAnalyser.bars[x] = 127 + *power;
reusableBuffer.spectrumAnalyser.bars[x] = 0x80 + *power;
}
}