1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 16:55:36 +03:00

Merge pull request #19 from the-kenny/master

Telemetry additions
This commit is contained in:
dongie 2013-11-24 18:16:41 -08:00
commit 4790bfc451

View file

@ -45,6 +45,8 @@
#define ID_GYRO_Y 0x41
#define ID_GYRO_Z 0x42
#define ID_VERT_SPEED 0x30 //opentx vario
// from sensors.c
extern uint8_t batteryCellCount;
@ -96,7 +98,7 @@ static void sendBaro(void)
sendDataHead(ID_ALTITUDE_BP);
serialize16(BaroAlt / 100);
sendDataHead(ID_ALTITUDE_AP);
serialize16(BaroAlt % 100);
serialize16(abs(BaroAlt % 100));
}
static void sendTemperature1(void)
@ -135,6 +137,16 @@ static void sendGPS(void)
serialize16(GPS_coord[LON] < 0 ? 'W' : 'E');
}
/*
* Send vertical speed for opentx. ID_VERT_SPEED
* Unit is cm/s
*/
static void sendVario(void)
{
sendDataHead(ID_VERT_SPEED);
serialize16(vario);
}
/*
* Send voltage via ID_VOLT
*
@ -246,6 +258,7 @@ void sendTelemetry(void)
// Sent every 125ms
sendAccel();
sendVario();
sendTelemetryTail();
if ((cycleNum % 4) == 0) { // Sent every 500ms