mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-21 15:25:36 +03:00
Fix compiler warning
This commit is contained in:
parent
2467b32f91
commit
cc3824a7c5
1 changed files with 9 additions and 20 deletions
|
@ -177,15 +177,11 @@ static void buildTelemetryFrame(uint8_t *packet)
|
||||||
frame[0] = 0x0E;//length
|
frame[0] = 0x0E;//length
|
||||||
frame[1] = rxCc2500SpiConfig()->bindTxId[0];
|
frame[1] = rxCc2500SpiConfig()->bindTxId[0];
|
||||||
frame[2] = rxCc2500SpiConfig()->bindTxId[1];
|
frame[2] = rxCc2500SpiConfig()->bindTxId[1];
|
||||||
switch(spiProtocol) {
|
|
||||||
case RX_SPI_FRSKY_X:
|
if (spiProtocol == RX_SPI_FRSKY_X_V2 || spiProtocol == RX_SPI_FRSKY_X_LBT_V2) {
|
||||||
case RX_SPI_FRSKY_X_LBT:
|
|
||||||
frame[3] = packet[3];
|
|
||||||
break;
|
|
||||||
case RX_SPI_FRSKY_X_V2:
|
|
||||||
case RX_SPI_FRSKY_X_LBT_V2:
|
|
||||||
frame[3] = rxCc2500SpiConfig()->bindTxId[2];
|
frame[3] = rxCc2500SpiConfig()->bindTxId[2];
|
||||||
break;
|
} else {
|
||||||
|
frame[3] = packet[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (evenRun) {
|
if (evenRun) {
|
||||||
|
@ -300,23 +296,16 @@ void frSkyXSetRcData(uint16_t *rcData, const uint8_t *packet)
|
||||||
|
|
||||||
bool isValidPacket(const uint8_t *packet)
|
bool isValidPacket(const uint8_t *packet)
|
||||||
{
|
{
|
||||||
|
bool useBindTxId2 = false;
|
||||||
|
|
||||||
if (spiProtocol == RX_SPI_FRSKY_X_V2 || spiProtocol == RX_SPI_FRSKY_X_LBT_V2) {
|
if (spiProtocol == RX_SPI_FRSKY_X_V2 || spiProtocol == RX_SPI_FRSKY_X_LBT_V2) {
|
||||||
|
useBindTxId2 = true;
|
||||||
if (!(packet[packetLength - 1] & 0x80)) {
|
if (!(packet[packetLength - 1] & 0x80)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t lcrc = calculateCrc(&packet[3], (packetLength - 7));
|
uint16_t lcrc = calculateCrc(&packet[3], (packetLength - 7));
|
||||||
bool useBindTxId2;
|
|
||||||
switch(spiProtocol) {
|
|
||||||
case RX_SPI_FRSKY_X:
|
|
||||||
case RX_SPI_FRSKY_X_LBT:
|
|
||||||
useBindTxId2 = false;
|
|
||||||
break;
|
|
||||||
case RX_SPI_FRSKY_X_V2:
|
|
||||||
case RX_SPI_FRSKY_X_LBT_V2:
|
|
||||||
useBindTxId2 = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((lcrc >> 8) == packet[packetLength - 4] && (lcrc & 0x00FF) == packet[packetLength - 3] &&
|
if ((lcrc >> 8) == packet[packetLength - 4] && (lcrc & 0x00FF) == packet[packetLength - 3] &&
|
||||||
(packet[0] == packetLength - 3) &&
|
(packet[0] == packetLength - 3) &&
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue