mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 11:29:58 +03:00
Fix rx spi processing required (#13454)
* fix RX_SPI_PROCESSING_REQUIRED - fix typo - remove unreachable 'return false;' in rxSpiProcessFrame * Simplify auxiliaryProcessingRequired rxRuntimeState.rcProcessFrameFn never returns false * fixup! fix RX_SPI_PROCESSING_REQUIRED --------- Co-authored-by: Petr Ledvina <ledvinap@hp124.ekotip.cz>
This commit is contained in:
parent
d22ea47736
commit
3aabaf365d
4 changed files with 5 additions and 8 deletions
|
@ -480,7 +480,7 @@ rx_spi_received_e frSkyXHandlePacket(uint8_t * const packet, uint8_t * const pro
|
||||||
|
|
||||||
#if defined(USE_TELEMETRY_SMARTPORT)
|
#if defined(USE_TELEMETRY_SMARTPORT)
|
||||||
if (telemetryEnabled) {
|
if (telemetryEnabled) {
|
||||||
ret |= RX_SPI_ROCESSING_REQUIRED;
|
ret |= RX_SPI_PROCESSING_REQUIRED;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
*protocolState = STATE_RESUME;
|
*protocolState = STATE_RESUME;
|
||||||
|
|
|
@ -769,7 +769,8 @@ void detectAndApplySignalLossBehaviour(void)
|
||||||
bool calculateRxChannelsAndUpdateFailsafe(timeUs_t currentTimeUs)
|
bool calculateRxChannelsAndUpdateFailsafe(timeUs_t currentTimeUs)
|
||||||
{
|
{
|
||||||
if (auxiliaryProcessingRequired) {
|
if (auxiliaryProcessingRequired) {
|
||||||
auxiliaryProcessingRequired = !rxRuntimeState.rcProcessFrameFn(&rxRuntimeState);
|
rxRuntimeState.rcProcessFrameFn(&rxRuntimeState);
|
||||||
|
auxiliaryProcessingRequired = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rxDataProcessingRequired) {
|
if (!rxDataProcessingRequired) {
|
||||||
|
|
|
@ -216,7 +216,7 @@ static uint8_t rxSpiFrameStatus(rxRuntimeState_t *rxRuntimeState)
|
||||||
status = RX_FRAME_COMPLETE;
|
status = RX_FRAME_COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result & RX_SPI_ROCESSING_REQUIRED) {
|
if (result & RX_SPI_PROCESSING_REQUIRED) {
|
||||||
status |= RX_FRAME_PROCESSING_REQUIRED;
|
status |= RX_FRAME_PROCESSING_REQUIRED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,10 +236,6 @@ static bool rxSpiProcessFrame(const rxRuntimeState_t *rxRuntimeState)
|
||||||
if (result & RX_SPI_RECEIVED_DATA) {
|
if (result & RX_SPI_RECEIVED_DATA) {
|
||||||
rxSpiNewPacketAvailable = true;
|
rxSpiNewPacketAvailable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result & RX_SPI_ROCESSING_REQUIRED) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -56,7 +56,7 @@ typedef enum {
|
||||||
RX_SPI_RECEIVED_NONE = 0,
|
RX_SPI_RECEIVED_NONE = 0,
|
||||||
RX_SPI_RECEIVED_BIND = (1 << 0),
|
RX_SPI_RECEIVED_BIND = (1 << 0),
|
||||||
RX_SPI_RECEIVED_DATA = (1 << 1),
|
RX_SPI_RECEIVED_DATA = (1 << 1),
|
||||||
RX_SPI_ROCESSING_REQUIRED = (1 << 2),
|
RX_SPI_PROCESSING_REQUIRED = (1 << 2),
|
||||||
} rx_spi_received_e;
|
} rx_spi_received_e;
|
||||||
|
|
||||||
// RC channels in AETR order
|
// RC channels in AETR order
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue