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;
}
+1 -1
View File
@@ -170,7 +170,7 @@ void sportProcessTelemetryPacketWithoutCrc(uint8_t origin, const uint8_t * packe
data = SPORT_DATA_U8(packet);
if (g_model.rssiSource) {
TelemetrySensor * sensor = & g_model.telemetrySensors[g_model.rssiSource];
if (sensor->instance == instance) {
if (sensor->isSameInstance(TELEM_PROTO_FRSKY_SPORT, instance)) {
telemetryData.rssi.set(data);
}
}
-6
View File
@@ -292,12 +292,6 @@ void telemetryInit(uint8_t protocol)
}
#endif
else if (protocol == PROTOCOL_TELEMETRY_PXX2) {
telemetryPortInit(PXX2_ON_SPORT_BAUDRATE, TELEMETRY_SERIAL_WITHOUT_DMA);
#if defined(LUA)
outputTelemetryBuffer.reset();
#endif
}
else {
telemetryPortInit(FRSKY_SPORT_BAUDRATE, TELEMETRY_SERIAL_WITHOUT_DMA);
#if defined(LUA)
-7
View File
@@ -126,13 +126,6 @@ inline uint8_t modelTelemetryProtocol()
return g_model.telemetryProtocol;
}
if (!IS_INTERNAL_MODULE_ENABLED() && isModulePXX2(EXTERNAL_MODULE)) {
return PROTOCOL_TELEMETRY_PXX2;
}
if (!IS_INTERNAL_MODULE_ENABLED() && isModulePXX(EXTERNAL_MODULE)) {
return PROTOCOL_TELEMETRY_FRSKY_SPORT;
}
#if defined(MULTIMODULE)
if (!IS_INTERNAL_MODULE_ENABLED() && g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_MULTIMODULE) {
return PROTOCOL_TELEMETRY_MULTIMODULE;