Fixed RX FIFO buffer flush on frame error.
This commit is contained in:
parent
bbf09b6027
commit
e78f9761bc
|
@ -249,7 +249,7 @@ rx_spi_received_e frSkyDHandlePacket(uint8_t * const packet, uint8_t * const pro
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!packetOk) {
|
if (!packetOk) {
|
||||||
cc2500Strobe(CC2500_SRX);
|
cc2500Strobe(CC2500_SFRX);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -369,12 +369,10 @@ rx_spi_received_e frSkyXHandlePacket(uint8_t * const packet, uint8_t * const pro
|
||||||
// here FS code could be
|
// here FS code could be
|
||||||
case STATE_DATA:
|
case STATE_DATA:
|
||||||
if (cc2500getGdo() && (frameReceived == false)){
|
if (cc2500getGdo() && (frameReceived == false)){
|
||||||
bool packetOk = false;
|
|
||||||
uint8_t ccLen = cc2500ReadReg(CC2500_3B_RXBYTES | CC2500_READ_BURST) & 0x7F;
|
uint8_t ccLen = cc2500ReadReg(CC2500_3B_RXBYTES | CC2500_READ_BURST) & 0x7F;
|
||||||
if (ccLen >= packetLength) {
|
if (ccLen >= packetLength) {
|
||||||
cc2500ReadFifo(packet, packetLength);
|
cc2500ReadFifo(packet, packetLength);
|
||||||
if (isValidPacket(packet)) {
|
if (isValidPacket(packet)) {
|
||||||
packetOk = true;
|
|
||||||
missingPackets = 0;
|
missingPackets = 0;
|
||||||
timeoutUs = 1;
|
timeoutUs = 1;
|
||||||
receiveDelayUs = 0;
|
receiveDelayUs = 0;
|
||||||
|
@ -450,11 +448,9 @@ rx_spi_received_e frSkyXHandlePacket(uint8_t * const packet, uint8_t * const pro
|
||||||
if (!frameReceived) {
|
if (!frameReceived) {
|
||||||
packetErrors++;
|
packetErrors++;
|
||||||
DEBUG_SET(DEBUG_RX_FRSKY_SPI, DEBUG_DATA_BAD_FRAME, packetErrors);
|
DEBUG_SET(DEBUG_RX_FRSKY_SPI, DEBUG_DATA_BAD_FRAME, packetErrors);
|
||||||
|
cc2500Strobe(CC2500_SFRX);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!packetOk) {
|
|
||||||
cc2500Strobe(CC2500_SRX);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (telemetryReceived) {
|
if (telemetryReceived) {
|
||||||
if (cmpTimeUs(micros(), packetTimerUs) > receiveDelayUs) { // if received or not received in this time sent telemetry data
|
if (cmpTimeUs(micros(), packetTimerUs) > receiveDelayUs) { // if received or not received in this time sent telemetry data
|
||||||
|
|
Loading…
Reference in New Issue