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 @@ -136,7 +136,6 @@ uint8_t ESBNetwork<radio_t>::update(void)
136136
137137 while (radio.available ()) {
138138 if (millis () > timeout) {
139- radio.flush_rx ();
140139 return NETWORK_OVERRUN;
141140 }
142141#if defined(ENABLE_DYNAMIC_PAYLOADS) && !defined(XMEGA_D3)
@@ -145,6 +144,10 @@ uint8_t ESBNetwork<radio_t>::update(void)
145144 frame_size = MAX_FRAME_SIZE;
146145#endif
147146
147+ if (!frame_size) {
148+ return NETWORK_CORRUPTION;
149+ }
150+
148151 // Fetch the payload, and see if this was the last one.
149152 radio.read (frame_buffer, frame_size);
150153
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