Spectrum analyser fixes
Compatibily issue when telemetry comes from int + ext modules
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user