Closed JohnOH closed 8 years ago
I've merged a somewhat altered version of this code - I think the whole problem can be ascribed to "rxstate = TXIDLE" being set too late in the "case TXRECV:" branch of the switch.
Does this not have the same problem outcome for rf12_canSend() since the packet isn't fully discarded until a call into rf12_recvdone happens. I think this code still has the stall..
Ah, I see your point. But hasn't this always been the case: when recvDone returns true, you get a brief hold on the data, and things resume on the next recvDone call. The RF12 code is written under the assumption of lots of polling to keep the FSM moving.
Hm.. need to think more about this, am re-opening this for now.
Yes, I think it has always been the case but I don't think it needs to be. Once it comes out of TXRECV it has to deliver something because rxfill != 0 if nothing else.
Depending on how the calling sketch uses rf12_recvDone and thence rf69::recvDone_compat. It is possible to stall in TXIDLE after a uninteresting non-broadcast packet is delay discarded rather than discarded immediatley.