Telemetry fixes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user