From 2b604a49ea64a7471ca107e2980299481538bffa Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Sat, 17 Mar 2018 22:50:06 +0100 Subject: [PATCH] FrSky new sensors support (#5766) FrSky new sensors support --- radio/src/telemetry/frsky.h | 18 ++++++++++++++++++ radio/src/telemetry/frsky_sport.cpp | 24 ++++++++++++++++++++++++ radio/src/translations/cz.h.txt | 11 +++++++++++ radio/src/translations/de.h.txt | 11 +++++++++++ radio/src/translations/en.h.txt | 11 +++++++++++ radio/src/translations/es.h.txt | 11 +++++++++++ radio/src/translations/fi.h.txt | 11 +++++++++++ radio/src/translations/fr.h.txt | 11 +++++++++++ radio/src/translations/it.h.txt | 11 +++++++++++ radio/src/translations/nl.h.txt | 11 +++++++++++ radio/src/translations/pl.h.txt | 11 +++++++++++ radio/src/translations/pt.h.txt | 11 +++++++++++ radio/src/translations/se.h.txt | 11 +++++++++++ 13 files changed, 163 insertions(+) diff --git a/radio/src/telemetry/frsky.h b/radio/src/telemetry/frsky.h index fb35627d5..3c9b1b4c9 100644 --- a/radio/src/telemetry/frsky.h +++ b/radio/src/telemetry/frsky.h @@ -151,6 +151,24 @@ enum FrSkyDataState { #define RBOX_STATE_LAST_ID 0x0b2f #define RBOX_CNSP_FIRST_ID 0x0b30 #define RBOX_CNSP_LAST_ID 0x0b3f +#define SD1_FIRST_ID 0x0b40 +#define SD1_LAST_ID 0x0b4f +#define ESC_POWER_FIRST_ID 0x0b50 +#define ESC_POWER_LAST_ID 0x0b5f +#define ESC_RPM_CONS_FIRST_ID 0x0b60 +#define ESC_RPM_CONS_LAST_ID 0x0b6f +#define ESC_TEMPERATURE_FIRST_ID 0x0b70 +#define ESC_TEMPERATURE_LAST_ID 0x0b7f +#define X8R_FIRST_ID 0x0c20 +#define X8R_LAST_ID 0x0c2f +#define S6R_FIRST_ID 0x0c30 +#define S6R_LAST_ID 0x0c3f +#define GASSUIT_TEMP_FIRST_ID 0x0d00 +#define GASSUIT_TEMP_LAST_ID 0x0d0f +#define GASSUIT_SPEED_FIRST_ID 0x0d10 +#define GASSUIT_SPEED_LAST_ID 0x0d1f +#define GASSUIT_FUEL_FIRST_ID 0x0d20 +#define GASSUIT_FUEL_LAST_ID 0x0d2f #define DIY_FIRST_ID 0x5000 #define DIY_LAST_ID 0x52ff #define DIY_STREAM_FIRST_ID 0x5000 diff --git a/radio/src/telemetry/frsky_sport.cpp b/radio/src/telemetry/frsky_sport.cpp index 65306e644..40bd8b305 100644 --- a/radio/src/telemetry/frsky_sport.cpp +++ b/radio/src/telemetry/frsky_sport.cpp @@ -63,6 +63,17 @@ const FrSkySportSensor sportSensors[] = { { RBOX_CNSP_FIRST_ID, RBOX_CNSP_LAST_ID, 1, ZSTR_BATT2_CONSUMPTION, UNIT_MAH, 0 }, { RBOX_STATE_FIRST_ID, RBOX_STATE_LAST_ID, 0, ZSTR_CHANS_STATE, UNIT_BITFIELD, 0 }, { RBOX_STATE_FIRST_ID, RBOX_STATE_LAST_ID, 1, ZSTR_RB_STATE, UNIT_BITFIELD, 0 }, + { SD1_FIRST_ID, SD1_LAST_ID, 0, ZSTR_SD1_CHANNEL, UNIT_RAW, 0 }, + { ESC_POWER_FIRST_ID, ESC_POWER_LAST_ID, 0, ZSTR_ESC_VOLTAGE, UNIT_VOLTS, 2 }, + { ESC_POWER_FIRST_ID, ESC_POWER_LAST_ID, 1, ZSTR_ESC_CURRENT, UNIT_AMPS, 2 }, + { ESC_RPM_CONS_FIRST_ID, ESC_RPM_CONS_LAST_ID, 0, ZSTR_ESC_RPM, UNIT_RPMS, 0 }, + { ESC_RPM_CONS_FIRST_ID, ESC_RPM_CONS_LAST_ID, 1, ZSTR_ESC_CONSUMPTION, UNIT_MAH, 0 }, + { ESC_TEMPERATURE_FIRST_ID, ESC_TEMPERATURE_LAST_ID, 0, ZSTR_ESC_TEMP, UNIT_CELSIUS, 0 }, + { GASSUIT_TEMP_FIRST_ID, GASSUIT_TEMP_LAST_ID, 0, ZSTR_GASSUIT_TEMP1, UNIT_CELSIUS, 0 }, + { GASSUIT_TEMP_FIRST_ID, GASSUIT_TEMP_LAST_ID, 1, ZSTR_GASSUIT_TEMP2, UNIT_CELSIUS, 0 }, + { GASSUIT_SPEED_FIRST_ID, GASSUIT_SPEED_LAST_ID, 0, ZSTR_GASSUIT_RPM, UNIT_RPMS, 0 }, + { GASSUIT_FUEL_FIRST_ID, GASSUIT_FUEL_LAST_ID, 0, ZSTR_GASSUIT_FLOW, UNIT_MILLILITERS, 0 }, //TODO this needs to be changed to ml/min, but need eeprom conversion + { GASSUIT_FUEL_FIRST_ID, GASSUIT_FUEL_LAST_ID, 1, ZSTR_GASSUIT_CONS, UNIT_MILLILITERS, 0 }, { 0, 0, 0, NULL, UNIT_RAW, 0 } // sentinel }; @@ -210,6 +221,19 @@ void sportProcessTelemetryPacket(const uint8_t * packet) sportProcessTelemetryPacket(id, 0, instance, servosState); sportProcessTelemetryPacket(id, 1, instance, rboxState); } + else if (id >= ESC_POWER_FIRST_ID && id <= ESC_RPM_CONS_LAST_ID) { + // 2 sensors (POWER and RPM_CONS) + sportProcessTelemetryPacket(id, 0, instance, data & 0xffff); + sportProcessTelemetryPacket(id, 1, instance, data >> 16); + } + else if (id >= ESC_TEMPERATURE_FIRST_ID && id <= ESC_TEMPERATURE_LAST_ID) { + sportProcessTelemetryPacket(id, 0, instance, data & 0x00ff); + } + else if (id >= GASSUIT_TEMP_FIRST_ID && id <= GASSUIT_FUEL_LAST_ID) { + // 2 sensors + sportProcessTelemetryPacket(id, 0, instance, data & 0xffff); + sportProcessTelemetryPacket(id, 1, instance, data >> 16); + } else if (id >= DIY_STREAM_FIRST_ID && id <= DIY_STREAM_LAST_ID) { #if defined(LUA) if (luaInputTelemetryFifo && luaInputTelemetryFifo->hasSpace(sizeof(SportTelemetryPacket))) { diff --git a/radio/src/translations/cz.h.txt b/radio/src/translations/cz.h.txt index 09d87c2d1..90fdd2b36 100644 --- a/radio/src/translations/cz.h.txt +++ b/radio/src/translations/cz.h.txt @@ -1366,3 +1366,14 @@ #define ZSTR_GATE_NUMBER "Gate" #define ZSTR_LAP_TIME "LapT" #define ZSTR_GATE_TIME "GteT" +#define ZSTR_ESC_VOLTAGE "EscV" +#define ZSTR_ESC_CURRENT "EscA" +#define ZSTR_ESC_RPM "EscR" +#define ZSTR_ESC_CONSUMPTION "EscC" +#define ZSTR_ESC_TEMP "EscT" +#define ZSTR_SD1_CHANNEL "Chan" +#define ZSTR_GASSUIT_TEMP1 "GTp1" +#define ZSTR_GASSUIT_TEMP2 "GTp2" +#define ZSTR_GASSUIT_RPM "GRPM" +#define ZSTR_GASSUIT_FLOW "GFlo" +#define ZSTR_GASSUIT_CONS "GFue" diff --git a/radio/src/translations/de.h.txt b/radio/src/translations/de.h.txt index ca98d5ff3..5d41419fb 100644 --- a/radio/src/translations/de.h.txt +++ b/radio/src/translations/de.h.txt @@ -1374,3 +1374,14 @@ #define ZSTR_GATE_NUMBER "Gate" #define ZSTR_LAP_TIME "LapT" #define ZSTR_GATE_TIME "GteT" +#define ZSTR_ESC_VOLTAGE "EscV" +#define ZSTR_ESC_CURRENT "EscA" +#define ZSTR_ESC_RPM "EscR" +#define ZSTR_ESC_CONSUMPTION "EscC" +#define ZSTR_ESC_TEMP "EscT" +#define ZSTR_SD1_CHANNEL "Chan" +#define ZSTR_GASSUIT_TEMP1 "GTp1" +#define ZSTR_GASSUIT_TEMP2 "GTp2" +#define ZSTR_GASSUIT_RPM "GRPM" +#define ZSTR_GASSUIT_FLOW "GFlo" +#define ZSTR_GASSUIT_CONS "GFue" diff --git a/radio/src/translations/en.h.txt b/radio/src/translations/en.h.txt index f1da13c03..95f5066c1 100644 --- a/radio/src/translations/en.h.txt +++ b/radio/src/translations/en.h.txt @@ -1372,3 +1372,14 @@ #define ZSTR_GATE_NUMBER "Gate" #define ZSTR_LAP_TIME "LapT" #define ZSTR_GATE_TIME "GteT" +#define ZSTR_ESC_VOLTAGE "EscV" +#define ZSTR_ESC_CURRENT "EscA" +#define ZSTR_ESC_RPM "EscR" +#define ZSTR_ESC_CONSUMPTION "EscC" +#define ZSTR_ESC_TEMP "EscT" +#define ZSTR_SD1_CHANNEL "Chan" +#define ZSTR_GASSUIT_TEMP1 "GTp1" +#define ZSTR_GASSUIT_TEMP2 "GTp2" +#define ZSTR_GASSUIT_RPM "GRPM" +#define ZSTR_GASSUIT_FLOW "GFlo" +#define ZSTR_GASSUIT_CONS "GFue" diff --git a/radio/src/translations/es.h.txt b/radio/src/translations/es.h.txt index 8b1bf46fa..4954f9e26 100644 --- a/radio/src/translations/es.h.txt +++ b/radio/src/translations/es.h.txt @@ -1344,3 +1344,14 @@ #define ZSTR_GATE_NUMBER "Gate" #define ZSTR_LAP_TIME "LapT" #define ZSTR_GATE_TIME "GteT" +#define ZSTR_ESC_VOLTAGE "EscV" +#define ZSTR_ESC_CURRENT "EscA" +#define ZSTR_ESC_RPM "EscR" +#define ZSTR_ESC_CONSUMPTION "EscC" +#define ZSTR_ESC_TEMP "EscT" +#define ZSTR_SD1_CHANNEL "Chan" +#define ZSTR_GASSUIT_TEMP1 "GTp1" +#define ZSTR_GASSUIT_TEMP2 "GTp2" +#define ZSTR_GASSUIT_RPM "GRPM" +#define ZSTR_GASSUIT_FLOW "GFlo" +#define ZSTR_GASSUIT_CONS "GFue" diff --git a/radio/src/translations/fi.h.txt b/radio/src/translations/fi.h.txt index 8912d19e9..3e4ba6b75 100644 --- a/radio/src/translations/fi.h.txt +++ b/radio/src/translations/fi.h.txt @@ -1334,3 +1334,14 @@ #define ZSTR_GATE_NUMBER "Gate" #define ZSTR_LAP_TIME "LapT" #define ZSTR_GATE_TIME "GteT" +#define ZSTR_ESC_VOLTAGE "EscV" +#define ZSTR_ESC_CURRENT "EscA" +#define ZSTR_ESC_RPM "EscR" +#define ZSTR_ESC_CONSUMPTION "EscC" +#define ZSTR_ESC_TEMP "EscT" +#define ZSTR_SD1_CHANNEL "Chan" +#define ZSTR_GASSUIT_TEMP1 "GTp1" +#define ZSTR_GASSUIT_TEMP2 "GTp2" +#define ZSTR_GASSUIT_RPM "GRPM" +#define ZSTR_GASSUIT_FLOW "GFlo" +#define ZSTR_GASSUIT_CONS "GFue" diff --git a/radio/src/translations/fr.h.txt b/radio/src/translations/fr.h.txt index fd9f78509..14a5a63f8 100644 --- a/radio/src/translations/fr.h.txt +++ b/radio/src/translations/fr.h.txt @@ -1373,3 +1373,14 @@ #define ZSTR_GATE_NUMBER "Gate" #define ZSTR_LAP_TIME "LapT" #define ZSTR_GATE_TIME "GteT" +#define ZSTR_ESC_VOLTAGE "EscV" +#define ZSTR_ESC_CURRENT "EscA" +#define ZSTR_ESC_RPM "EscR" +#define ZSTR_ESC_CONSUMPTION "EscC" +#define ZSTR_ESC_TEMP "EscT" +#define ZSTR_SD1_CHANNEL "Chan" +#define ZSTR_GASSUIT_TEMP1 "GTp1" +#define ZSTR_GASSUIT_TEMP2 "GTp2" +#define ZSTR_GASSUIT_RPM "GRPM" +#define ZSTR_GASSUIT_FLOW "GFlo" +#define ZSTR_GASSUIT_CONS "GFue" diff --git a/radio/src/translations/it.h.txt b/radio/src/translations/it.h.txt index d63236350..0ff7d7ddf 100644 --- a/radio/src/translations/it.h.txt +++ b/radio/src/translations/it.h.txt @@ -1370,3 +1370,14 @@ #define ZSTR_GATE_NUMBER "Gate" #define ZSTR_LAP_TIME "LapT" #define ZSTR_GATE_TIME "GteT" +#define ZSTR_ESC_VOLTAGE "EscV" +#define ZSTR_ESC_CURRENT "EscA" +#define ZSTR_ESC_RPM "EscR" +#define ZSTR_ESC_CONSUMPTION "EscC" +#define ZSTR_ESC_TEMP "EscT" +#define ZSTR_SD1_CHANNEL "Chan" +#define ZSTR_GASSUIT_TEMP1 "GTp1" +#define ZSTR_GASSUIT_TEMP2 "GTp2" +#define ZSTR_GASSUIT_RPM "GRPM" +#define ZSTR_GASSUIT_FLOW "GFlo" +#define ZSTR_GASSUIT_CONS "GFue" diff --git a/radio/src/translations/nl.h.txt b/radio/src/translations/nl.h.txt index e418a3882..5b215160f 100644 --- a/radio/src/translations/nl.h.txt +++ b/radio/src/translations/nl.h.txt @@ -1367,3 +1367,14 @@ #define ZSTR_GATE_NUMBER "Gate" #define ZSTR_LAP_TIME "LapT" #define ZSTR_GATE_TIME "GteT" +#define ZSTR_ESC_VOLTAGE "EscV" +#define ZSTR_ESC_CURRENT "EscA" +#define ZSTR_ESC_RPM "EscR" +#define ZSTR_ESC_CONSUMPTION "EscC" +#define ZSTR_ESC_TEMP "EscT" +#define ZSTR_SD1_CHANNEL "Chan" +#define ZSTR_GASSUIT_TEMP1 "GTp1" +#define ZSTR_GASSUIT_TEMP2 "GTp2" +#define ZSTR_GASSUIT_RPM "GRPM" +#define ZSTR_GASSUIT_FLOW "GFlo" +#define ZSTR_GASSUIT_CONS "GFue" diff --git a/radio/src/translations/pl.h.txt b/radio/src/translations/pl.h.txt index 7f07fdcc3..e4fd825e1 100644 --- a/radio/src/translations/pl.h.txt +++ b/radio/src/translations/pl.h.txt @@ -1373,3 +1373,14 @@ #define ZSTR_GATE_NUMBER "Gate" #define ZSTR_LAP_TIME "LapT" #define ZSTR_GATE_TIME "GteT" +#define ZSTR_ESC_VOLTAGE "EscV" +#define ZSTR_ESC_CURRENT "EscA" +#define ZSTR_ESC_RPM "EscR" +#define ZSTR_ESC_CONSUMPTION "EscC" +#define ZSTR_ESC_TEMP "EscT" +#define ZSTR_SD1_CHANNEL "Chan" +#define ZSTR_GASSUIT_TEMP1 "GTp1" +#define ZSTR_GASSUIT_TEMP2 "GTp2" +#define ZSTR_GASSUIT_RPM "GRPM" +#define ZSTR_GASSUIT_FLOW "GFlo" +#define ZSTR_GASSUIT_CONS "GFue" diff --git a/radio/src/translations/pt.h.txt b/radio/src/translations/pt.h.txt index b1da427b8..37478b5c6 100644 --- a/radio/src/translations/pt.h.txt +++ b/radio/src/translations/pt.h.txt @@ -1347,3 +1347,14 @@ #define ZSTR_GATE_NUMBER "Gate" #define ZSTR_LAP_TIME "LapT" #define ZSTR_GATE_TIME "GteT" +#define ZSTR_ESC_VOLTAGE "EscV" +#define ZSTR_ESC_CURRENT "EscA" +#define ZSTR_ESC_RPM "EscR" +#define ZSTR_ESC_CONSUMPTION "EscC" +#define ZSTR_ESC_TEMP "EscT" +#define ZSTR_SD1_CHANNEL "Chan" +#define ZSTR_GASSUIT_TEMP1 "GTp1" +#define ZSTR_GASSUIT_TEMP2 "GTp2" +#define ZSTR_GASSUIT_RPM "GRPM" +#define ZSTR_GASSUIT_FLOW "GFlo" +#define ZSTR_GASSUIT_CONS "GFue" diff --git a/radio/src/translations/se.h.txt b/radio/src/translations/se.h.txt index 67e6894f9..646bc1879 100644 --- a/radio/src/translations/se.h.txt +++ b/radio/src/translations/se.h.txt @@ -1380,3 +1380,14 @@ #define ZSTR_GATE_NUMBER "Gate" #define ZSTR_LAP_TIME "LapT" #define ZSTR_GATE_TIME "GteT" +#define ZSTR_ESC_VOLTAGE "EscV" +#define ZSTR_ESC_CURRENT "EscA" +#define ZSTR_ESC_RPM "EscR" +#define ZSTR_ESC_CONSUMPTION "EscC" +#define ZSTR_ESC_TEMP "EscT" +#define ZSTR_SD1_CHANNEL "Chan" +#define ZSTR_GASSUIT_TEMP1 "GTp1" +#define ZSTR_GASSUIT_TEMP2 "GTp2" +#define ZSTR_GASSUIT_RPM "GRPM" +#define ZSTR_GASSUIT_FLOW "GFlo" +#define ZSTR_GASSUIT_CONS "GFue"