1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-14 20:10:18 +03:00

Merge pull request #7345 from joelucid/frsky_failsafe

ignore failsafe packets in rx_spi_frskyx
This commit is contained in:
Michael Keller 2019-01-09 01:21:55 +13:00 committed by GitHub
commit cf196758da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -196,9 +196,9 @@ static bool tuneRx(uint8_t *packet)
if (packet[ccLen - 1] & 0x80) {
if (packet[2] == 0x01) {
uint8_t Lqi = packet[ccLen - 1] & 0x7F;
if (Lqi < 50) {
// higher lqi represent better link quality
if (Lqi > 50) {
rxFrSkySpiConfigMutable()->bindOffset = bindOffset;
return true;
}
}

View file

@ -274,6 +274,10 @@ static void frSkyXTelemetryWriteFrame(const smartPortPayload_t *payload)
void frSkyXSetRcData(uint16_t *rcData, const uint8_t *packet)
{
uint16_t c[8];
// ignore failsafe packet
if (packet[7] != 0) {
return;
}
c[0] = (uint16_t)((packet[10] << 8) & 0xF00) | packet[9];
c[1] = (uint16_t)((packet[11] << 4) & 0xFF0) | (packet[10] >> 4);
c[2] = (uint16_t)((packet[13] << 8) & 0xF00) | packet[12];