AFHDS2A extended telemetry forward

This commit is contained in:
Pascal Langer 2019-05-10 18:17:09 +02:00
parent 1916eb3095
commit 1a8f9c5a12
2 changed files with 53 additions and 53 deletions

View File

@ -87,16 +87,22 @@ static void AFHDS2A_update_telemetry()
// max 7 sensors per packet
#ifdef AFHDS2A_FW_TELEMETRY
if (option & 0x80)
{
// forward telemetry to TX, skip rx and tx id to save space
{// 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++)
{
pkt[i-8]=packet[i];
debug(" %02X",packet[i]);
}
telemetry_link=2;
debugln("");
return;
}
#endif
#ifdef AFHDS2A_HUB_TELEMETRY
if(packet[0]==0xAA)
{ // 0xAA Normal telemetry, 0xAC Extended telemetry not decoded here
for(uint8_t sensor=0; sensor<7; sensor++)
{
// Send FrSkyD telemetry to TX
@ -118,13 +124,14 @@ static void AFHDS2A_update_telemetry()
case AFHDS2A_SENSOR_RX_RSSI:
RX_RSSI = -packet[index+2];
break;
case 0xff:
case 0xff: // end of data
return;
/*default:
// unknown sensor ID
break;*/
}
}
}
#endif
}
#endif
@ -323,20 +330,13 @@ uint16_t ReadAFHDS2A()
if(!(A7105_ReadReg(A7105_00_MODE) & (1<<5 | 1<<6)) && data_rx==1)
{ // RX+FECF+CRCF Ok
A7105_ReadData(AFHDS2A_RXPACKET_SIZE);
#ifdef DEBUG_SERIAL
debug("T=");
for(uint8_t i=0;i < AFHDS2A_RXPACKET_SIZE; i++)
{
debug(" %02X",packet[i]);
}
debugln("");
#endif
if(packet[0] == 0xaa)
{
if(packet[9] == 0xfc)
if(packet[0] == 0xAA && packet[9] == 0xFC)
packet_type=AFHDS2A_PACKET_SETTINGS; // RX is asking for settings
else
if(packet[0] == 0xAA || packet[0] == 0xAC)
{
if(memcmp(&packet[1], rx_tx_addr, 4))
{ // Validate TX address
#ifdef AFHDS2A_LQI_CH
for(uint8_t sensor=0; sensor<7; sensor++)
{//read LQI value for RX output

View File

@ -19,7 +19,7 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 2
#define VERSION_REVISION 1
#define VERSION_PATCH_LEVEL 43
#define VERSION_PATCH_LEVEL 44
//******************
// Protocols