Skip to content

Commit

Permalink
faet: add sport roll/pitch sensors
Browse files Browse the repository at this point in the history
  • Loading branch information
3djc committed Sep 21, 2023
1 parent b6e6d90 commit 87001cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions radio/src/telemetry/frsky_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
#define ACCY_LAST_ID 0x071F
#define ACCZ_FIRST_ID 0x0720
#define ACCZ_LAST_ID 0x072F
#define ANGLE_FIRST_ID 0x0730
#define ANGLE_LAST_ID 0x073F
#define GPS_LONG_LATI_FIRST_ID 0x0800
#define GPS_LONG_LATI_LAST_ID 0x080F
#define GPS_ALT_FIRST_ID 0x0820
Expand Down
6 changes: 6 additions & 0 deletions radio/src/telemetry/frsky_sport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ const FrSkySportSensor sportSensors[] = {
{ ACCX_FIRST_ID, ACCX_LAST_ID, 0, STR_SENSOR_ACCX, UNIT_G, 3 },
{ ACCY_FIRST_ID, ACCY_LAST_ID, 0, STR_SENSOR_ACCY, UNIT_G, 3 },
{ ACCZ_FIRST_ID, ACCZ_LAST_ID, 0, STR_SENSOR_ACCZ, UNIT_G, 3 },
{ ANGLE_FIRST_ID, ANGLE_LAST_ID, 0, STR_SENSOR_ROLL, UNIT_DEGREE, 2 },
{ ANGLE_FIRST_ID, ANGLE_LAST_ID, 1, STR_SENSOR_PITCH, UNIT_DEGREE, 2 },
{ CURR_FIRST_ID, CURR_LAST_ID, 0, STR_SENSOR_CURR, UNIT_AMPS, 1 },
{ VFAS_FIRST_ID, VFAS_LAST_ID, 0, STR_SENSOR_VFAS, UNIT_VOLTS, 2 },
{ AIR_SPEED_FIRST_ID, AIR_SPEED_LAST_ID, 0, STR_SENSOR_ASPD, UNIT_KTS, 1 },
Expand Down Expand Up @@ -415,6 +417,10 @@ void sportProcessTelemetryPacketWithoutCrc(uint8_t module, uint8_t origin, const
servosState = newServosState;
}
}
else if (dataId >= ANGLE_FIRST_ID && dataId <= ANGLE_LAST_ID) {
sportProcessTelemetryPacket(dataId, 0, instance, data & 0xFFFFu);
sportProcessTelemetryPacket(dataId, 1, instance, data >> 16u);
}
else {
sportProcessTelemetryPacket(dataId, 0, instance, data);
}
Expand Down

0 comments on commit 87001cd

Please sign in to comment.