Telemetry fixes

This commit is contained in:
Bertrand Songis
2019-04-16 11:26:36 +02:00
parent 0a2d2a9b99
commit 2d26a74b18
7 changed files with 39 additions and 20 deletions
-10
View File
@@ -292,16 +292,6 @@ void telemetryInit(uint8_t protocol);
void telemetryInterrupt10ms();
enum TelemetryProtocol
{
TELEM_PROTO_FRSKY_D,
TELEM_PROTO_FRSKY_SPORT,
TELEM_PROTO_CROSSFIRE,
TELEM_PROTO_SPEKTRUM,
TELEM_PROTO_LUA,
TELEM_PROTO_FLYSKY_IBUS,
};
struct TelemetryData {
TelemetryValue swr;
FilteredTelemetryValue rssi;
+1 -3
View File
@@ -159,9 +159,7 @@ void sportProcessTelemetryPacketWithoutCrc(uint8_t origin, const uint8_t * packe
#if defined(BLUETOOTH)
if (g_eeGeneral.bluetoothMode == BLUETOOTH_TELEMETRY && bluetoothState == BLUETOOTH_STATE_CONNECTED) {
for (uint8_t i = 0; i < sizeof(SportTelemetryPacket); i++) {
bluetoothForwardTelemetry(packet[i]);
}
bluetoothForwardTelemetry(packet);
}
#endif
+1 -1
View File
@@ -485,7 +485,7 @@ int setTelemetryValue(TelemetryProtocol protocol, uint16_t id, uint8_t subId, ui
for (int index=0; index<MAX_TELEMETRY_SENSORS; index++) {
TelemetrySensor & telemetrySensor = g_model.telemetrySensors[index];
if (telemetrySensor.type == TELEM_TYPE_CUSTOM && telemetrySensor.id == id && telemetrySensor.subId == subId && (telemetrySensor.instance == instance || g_model.ignoreSensorIds)) {
if (telemetrySensor.type == TELEM_TYPE_CUSTOM && telemetrySensor.id == id && telemetrySensor.subId == subId && (telemetrySensor.isSameInstance(protocol, instance) || g_model.ignoreSensorIds)) {
telemetryItems[index].setValue(telemetrySensor, value, unit, prec);
available = true;
// we continue search here, because sensors can share the same id and instance