Multi Telemetry: fixed DSM

This commit is contained in:
pascallanger 2016-12-23 09:48:13 +01:00
parent 8efa5bc1dc
commit 72ebe937fb
2 changed files with 12 additions and 9 deletions

View File

@ -19,7 +19,7 @@
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 1 #define VERSION_MINOR 1
#define VERSION_REVISION 6 #define VERSION_REVISION 6
#define VERSION_PATCH_LEVEL 3 #define VERSION_PATCH_LEVEL 4
//****************** //******************
// Protocols // Protocols

View File

@ -101,22 +101,25 @@ static void multi_send_status()
#ifdef MULTI_TELEMETRY #ifdef MULTI_TELEMETRY
void DSM_frame() void DSM_frame()
{ {
if (pkt[0] == 0x80) { if (pkt[0] == 0x80)
{
multi_send_header(MULTI_TELEMETRY_DSMBIND, 10); multi_send_header(MULTI_TELEMETRY_DSMBIND, 10);
for (uint8_t i = 1; i < 11; i++) // 10 byte of DSM bind response for (uint8_t i = 1; i < 11; i++) // 10 bytes of DSM bind response
Serial_write(pkt[i]); Serial_write(pkt[i]);
} else { }
else
{
multi_send_header(MULTI_TELEMETRY_DSM, 17); multi_send_header(MULTI_TELEMETRY_DSM, 17);
for (uint8_t i = 0; i < 29; i++) // RSSI value followed by 4*7 bytes of telemetry data for (uint8_t i = 0; i < 17; i++) // RSSI value followed by 16 bytes of telemetry data
Serial_write(pkt[i]); Serial_write(pkt[i]);
} }
} }
#else #else
void DSM_frame() void DSM_frame()
{ {
Serial_write(0xAA); // Telemetry packet Serial_write(0xAA); // Telemetry packet
for (uint8_t i = 0; i < 17; i++) // RSSI value followed by 16 bytes of telemetry data for (uint8_t i = 0; i < 17; i++) // RSSI value followed by 16 bytes of telemetry data
Serial_write(pkt[i]); Serial_write(pkt[i]);
} }
#endif #endif
@ -128,9 +131,9 @@ static void multi_send_status()
#if defined MULTI_TELEMETRY #if defined MULTI_TELEMETRY
multi_send_header(MULTI_TELEMETRY_AFHDS2A, 29); multi_send_header(MULTI_TELEMETRY_AFHDS2A, 29);
#else #else
Serial_write(0xAA); // Telemetry packet Serial_write(0xAA); // Telemetry packet
#endif #endif
for (uint8_t i = 0; i < 29; i++) // RSSI value followed by 4*7 bytes of telemetry data for (uint8_t i = 0; i < 29; i++) // RSSI value followed by 4*7 bytes of telemetry data
Serial_write(pkt[i]); Serial_write(pkt[i]);
} }
#endif #endif