mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-18 08:54:15 +01:00
RFM22B: Added check for timeout wating for sync on receive. This virtually eliminates the number of timeouts.
This commit is contained in:
parent
88be2ddf1e
commit
6972c29813
@ -835,6 +835,7 @@ static void PIOS_RFM22B_Task(void *parameters)
|
||||
}
|
||||
else
|
||||
{
|
||||
rfm22b_dev->resets = rfm22b_dev->state;
|
||||
enum pios_rfm22b_event event = RFM22B_EVENT_TIMEOUT;
|
||||
while(event != RFM22B_EVENT_NUM_EVENTS)
|
||||
event = rfm22_process_state_transition(rfm22b_dev, event);
|
||||
@ -1400,6 +1401,11 @@ static enum pios_rfm22b_event rfm22_detectSync(struct pios_rfm22b_dev *rfm22b_de
|
||||
|
||||
return RFM22B_EVENT_SYNC_DETECTED;
|
||||
}
|
||||
else if (rfm22b_dev->int_status2 & !RFM22_is2_ipreaval)
|
||||
{
|
||||
// Waiting for sync timed out.
|
||||
return RFM22B_EVENT_TX_START;
|
||||
}
|
||||
|
||||
return RFM22B_EVENT_NUM_EVENTS;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user