File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,6 @@ uint8_t RF24Network::update(void)
129129
130130 while (radio.available ()) {
131131 if (millis () > timeout) {
132- radio.flush_rx ();
133132 return NETWORK_OVERRUN;
134133 }
135134#if defined(ENABLE_DYNAMIC_PAYLOADS) && !defined(XMEGA_D3)
@@ -138,6 +137,10 @@ uint8_t RF24Network::update(void)
138137 frame_size = MAX_FRAME_SIZE;
139138#endif
140139
140+ if (!frame_size) {
141+ return NETWORK_CORRUPTION;
142+ }
143+
141144 // Fetch the payload, and see if this was the last one.
142145 radio.read (frame_buffer, frame_size);
143146
Original file line number Diff line number Diff line change 123123// #define NETWORK_ACK_REQUEST 192
124124
125125/* *
126- * Messages of this type indicate the network is being overrun with data & the RX FIFO has been flushed .
126+ * Messages of this type indicate the network is being overrun with data.
127127 **/
128128#define NETWORK_OVERRUN 160
129129
130+ /* *
131+ * Messages of this type indicate radio data corruption & the RX FIFO has been flushed.
132+ **/
133+ #define NETWORK_CORRUPTION 161
134+
130135/* *
131136 * Messages of this type signal the sender that a network-wide transmission has been completed.
132137 *
You can’t perform that action at this time.
0 commit comments