FrSkyX: small change

This commit is contained in:
Pascal Langer 2020-06-05 22:22:13 +02:00
parent 3705415927
commit 374b46966c
2 changed files with 8 additions and 6 deletions

View File

@ -69,14 +69,18 @@ static void __attribute__((unused)) FrSkyX_channels(uint8_t offset)
FAILSAFE_VALUES_off;
}
failsafe_count++;
packet[7] = FS_flag;
if(protocol==PROTO_FRSKY_R9)
failsafe_count++; // R9 is 20ms, X is 9ms
packet[offset] = FS_flag;
#else
packet[7] = 0;
packet[offset] = 0;
#endif
//
packet[offset+1] = 0; //??
//
uint8_t chan_index = chan_start;
uint16_t ch1,ch2;
for(uint8_t i = offset; i < 12+offset ; i+=3)
for(uint8_t i = offset+2; i < 12+offset+2 ; i+=3)
{//12 bytes of channel data
#ifdef FAILSAFE_ENABLE
if( (FS_flag & 0x10) && ((failsafe_chan & 0x07) == (chan_index & 0x07)) )

View File

@ -98,9 +98,7 @@ static void __attribute__((unused)) FrSkyX_build_packet()
packet[5] = FrSkyX_chanskip>>2;
packet[6] = RX_num;
packet[8] = 0; //??
FrSkyX_channels(9); // Set packet[7] and packet[9..20] with channels data and failsafe
FrSkyX_channels(7); // Set packet[7]=failsafe, packet[8]=0?? and packet[9..20]=channels data
//sequence and send SPort
for (uint8_t i=22;i<packet_size-1;i++)