AFHDS2A telemetry AA and AC

This commit is contained in:
Pascal Langer 2019-09-14 16:27:07 +02:00
parent 8601149051
commit 3c76ce9f39
4 changed files with 16 additions and 8 deletions

View File

@ -89,12 +89,13 @@ static void AFHDS2A_update_telemetry()
if (option & 0x80)
{// forward 0xAA and 0xAC telemetry to TX, skip rx and tx id to save space
pkt[0]= TX_RSSI;
debug("T=");
for(int i=9;i < AFHDS2A_RXPACKET_SIZE; i++)
debug("T(%02X)=",packet[0]);
for(uint8_t i=9;i < AFHDS2A_RXPACKET_SIZE; i++)
{
pkt[i-8]=packet[i];
debug(" %02X",packet[i]);
}
pkt[29]=packet[0]; // 0xAA Normal telemetry, 0xAC Extended telemetry
telemetry_link=2;
debugln("");
return;

View File

@ -19,7 +19,7 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 2
#define VERSION_REVISION 1
#define VERSION_PATCH_LEVEL 76
#define VERSION_PATCH_LEVEL 77
//******************
// Protocols
@ -320,6 +320,7 @@ enum MultiPacketTypes
MULTI_TELEMETRY_SPORT_POLLING = 9,
MULTI_TELEMETRY_HITEC = 10,
MULTI_TELEMETRY_SCANNER = 11,
MULTI_TELEMETRY_AFHDS2A_AC = 12,
};
// Macros
@ -875,7 +876,7 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
technically DSM bind data is only 10 bytes but multi sends 16
like with telemtery, check length field)
Type 0x06 Flysky AFHDS2 telemetry data
Type 0x06 Flysky AFHDS2 telemetry data type 0xAA
length: 29
data[0] = RSSI value
data[1-28] telemetry data
@ -892,4 +893,10 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
length: 6
data[0] = start channel (2400 + x*0.333 Mhz)
data[1-5] power levels
Type 0x0C Flysky AFHDS2 telemetry data type 0xAC
length: 29
data[0] = RSSI value
data[1-28] telemetry data
*/

View File

@ -171,7 +171,7 @@ volatile uint8_t rx_ok_buff[RXBUFFER_SIZE];
volatile uint8_t discard_frame = 0;
// Telemetry
#define MAX_PKT 29
#define MAX_PKT 30
uint8_t pkt[MAX_PKT];//telemetry receiving packets
#if defined(TELEMETRY)
#ifdef INVERT_TELEMETRY

View File

@ -188,9 +188,9 @@ static void multi_send_status()
void AFHDSA_short_frame()
{
#if defined MULTI_TELEMETRY
multi_send_header(MULTI_TELEMETRY_AFHDS2A, 29);
multi_send_header(pkt[29]==0xAA?MULTI_TELEMETRY_AFHDS2A,MULTI_TELEMETRY_AFHDS2A_AC, 29);
#else
Serial_write(0xAA); // Telemetry packet
Serial_write(pkt[29]); // Telemetry packet 0xAA or 0xAC
#endif
for (uint8_t i = 0; i < 29; i++) // RSSI value followed by 4*7 bytes of telemetry data
Serial_write(pkt[i]);