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:
commit
cf196758da
2 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue