Spectrum analyser fixes

Compatibily issue when telemetry comes from int + ext modules
This commit is contained in:
Bertrand Songis
2019-04-29 11:52:17 +02:00
parent 14c282110d
commit d70f3a40ef
12 changed files with 13 additions and 39 deletions
+1 -1
View File
@@ -218,7 +218,7 @@ void processSpectrumAnalyserFrame(uint8_t module, uint8_t * frame)
// TRACE("Fq=%u, Pw=%d, X=%d, Y=%d", *frequency, int32_t(*power), D * 128 / 40000000, int32_t(127 + *power));
int32_t position = *frequency - (reusableBuffer.spectrumAnalyser.freq - reusableBuffer.spectrumAnalyser.span / 2);
int32_t x = (position * LCD_W / 8) / (reusableBuffer.spectrumAnalyser.span / 8);
uint32_t x = (position * LCD_W / 8) / (reusableBuffer.spectrumAnalyser.span / 8);
if (x < LCD_W) {
reusableBuffer.spectrumAnalyser.bars[x] = 127 + *power;
}