Nicholas/telemetry for rb30 40 (#7454)

Added telemetry for RB3040
This commit is contained in:
Nicholas-Luoyi
2020-03-24 07:50:09 +01:00
committed by GitHub
parent 1f4ae1ddb9
commit 5be7fa3339
14 changed files with 156 additions and 10 deletions
+10
View File
@@ -150,6 +150,16 @@ enum FrSkyDataState {
#define ESC_RPM_CONS_LAST_ID 0x0B6f
#define ESC_TEMPERATURE_FIRST_ID 0x0B70
#define ESC_TEMPERATURE_LAST_ID 0x0B7f
#define RB3040_OUTPUT_FIRST_ID 0x0B80
#define RB3040_OUTPUT_LAST_ID 0x0B8F
#define RB3040_CH1_2_FIRST_ID 0x0B90
#define RB3040_CH1_2_LAST_ID 0x0B9F
#define RB3040_CH3_4_FIRST_ID 0x0BA0
#define RB3040_CH3_4_LAST_ID 0x0BAF
#define RB3040_CH5_6_FIRST_ID 0x0BB0
#define RB3040_CH5_6_LAST_ID 0x0BBF
#define RB3040_CH7_8_FIRST_ID 0x0BC0
#define RB3040_CH7_8_LAST_ID 0x0BCF
#define X8R_FIRST_ID 0x0c20
#define X8R_LAST_ID 0x0c2F
#define S6R_FIRST_ID 0x0c30
+13
View File
@@ -84,6 +84,15 @@ const FrSkySportSensor sportSensors[] = {
{ GASSUIT_AVG_FLOW_FIRST_ID, GASSUIT_AVG_FLOW_LAST_ID, 0, ZSTR_GASSUIT_AVG_FLOW, UNIT_MILLILITERS_PER_MINUTE, 0 },
{ SBEC_POWER_FIRST_ID, SBEC_POWER_LAST_ID, 0, ZSTR_SBEC_VOLTAGE, UNIT_VOLTS, 2 },
{ SBEC_POWER_FIRST_ID, SBEC_POWER_LAST_ID, 1, ZSTR_SBEC_CURRENT, UNIT_AMPS, 2 },
{ RB3040_OUTPUT_FIRST_ID, RB3040_OUTPUT_LAST_ID, 0, ZSTR_RB3040_EXTRA_STATE, UNIT_BITFIELD, 0 },
{ RB3040_CH1_2_FIRST_ID, RB3040_CH1_2_LAST_ID, 0, ZSTR_RB3040_CHANNEL1, UNIT_AMPS, 2 },
{ RB3040_CH1_2_FIRST_ID, RB3040_CH1_2_LAST_ID, 1, ZSTR_RB3040_CHANNEL2, UNIT_AMPS, 2 },
{ RB3040_CH3_4_FIRST_ID, RB3040_CH3_4_LAST_ID, 0, ZSTR_RB3040_CHANNEL3, UNIT_AMPS, 2 },
{ RB3040_CH3_4_FIRST_ID, RB3040_CH3_4_LAST_ID, 1, ZSTR_RB3040_CHANNEL4, UNIT_AMPS, 2 },
{ RB3040_CH5_6_FIRST_ID, RB3040_CH5_6_LAST_ID, 0, ZSTR_RB3040_CHANNEL5, UNIT_AMPS, 2 },
{ RB3040_CH5_6_FIRST_ID, RB3040_CH5_6_LAST_ID, 1, ZSTR_RB3040_CHANNEL6, UNIT_AMPS, 2 },
{ RB3040_CH7_8_FIRST_ID, RB3040_CH7_8_LAST_ID, 0, ZSTR_RB3040_CHANNEL7, UNIT_AMPS, 2 },
{ RB3040_CH7_8_FIRST_ID, RB3040_CH7_8_LAST_ID, 1, ZSTR_RB3040_CHANNEL8, UNIT_AMPS, 2 },
{ 0, 0, 0, NULL, UNIT_RAW, 0 } // sentinel
};
@@ -308,6 +317,10 @@ void sportProcessTelemetryPacketWithoutCrc(uint8_t origin, const uint8_t * packe
}
#endif
}
else if (dataId >= RB3040_CH1_2_FIRST_ID && dataId <= RB3040_CH7_8_LAST_ID) {
sportProcessTelemetryPacket(dataId, 0, instance, data & 0xffff);
sportProcessTelemetryPacket(dataId, 1, instance, (data >> 16u) & 0xffff);
}
else {
sportProcessTelemetryPacket(dataId, 0, instance, data);
}