@@ -300,32 +300,36 @@ void assessInterruptEvent() {
300
300
301
301
Serial.println (F (" \t IRQ pin is actively LOW" )); // show that this function was called
302
302
delayMicroseconds (250 );
303
- StatusFlags flags ( radio.clearStatusFlags () );
303
+ uint8_t flags = radio.clearStatusFlags ();
304
304
// Resetting the tx_df flag is required for
305
305
// continued TX operations when a transmission fails.
306
306
// clearing the status flags resets the IRQ pin to its inactive state (HIGH)
307
-
307
+ #ifdef printf_P
308
+ Serial.print (F (" \t " ));
309
+ radio.printStatus (flags);
310
+ #else
308
311
Serial.print (F (" \t data_sent: " ));
309
- Serial.print (flags. tx_ds () ); // print "data sent" flag state
312
+ Serial.print ((flags & RF24_TX_DS) > 0 ); // print "data sent" flag state
310
313
Serial.print (F (" , data_fail: " ));
311
- Serial.print (flags. tx_df () ); // print "data fail" flag state
314
+ Serial.print ((flags & RF24_TX_DF) > 0 ); // print "data fail" flag state
312
315
Serial.print (F (" , data_ready: " ));
313
- Serial.println (flags.rx_dr ()); // print "data ready" flag state
316
+ Serial.println ((flags & RF24_RX_DR) > 0 ); // print "data ready" flag state
317
+ #endif
314
318
315
- if (flags. tx_df ()) // if TX payload failed
316
- radio.flush_tx (); // clear all payloads from the TX FIFO
319
+ if (flags & RF24_TX_DF) // if TX payload failed
320
+ radio.flush_tx (); // clear all payloads from the TX FIFO
317
321
318
322
// print if test passed or failed. Unintentional fails mean the RX node was not listening.
319
323
// pl_iterator has already been incremented by now
320
324
if (pl_iterator <= 1 ) {
321
325
Serial.print (F (" 'Data Ready' event test " ));
322
- Serial.println (flags. rx_dr () ? F (" passed" ) : F (" failed" ));
326
+ Serial.println (flags & RF24_RX_DR ? F (" passed" ) : F (" failed" ));
323
327
} else if (pl_iterator == 2 ) {
324
328
Serial.print (F (" 'Data Sent' event test " ));
325
- Serial.println (flags. tx_ds () ? F (" passed" ) : F (" failed" ));
329
+ Serial.println (flags & RF24_TX_DS ? F (" passed" ) : F (" failed" ));
326
330
} else if (pl_iterator == 4 ) {
327
331
Serial.print (F (" 'Data Fail' event test " ));
328
- Serial.println (flags. tx_df () ? F (" passed" ) : F (" failed" ));
332
+ Serial.println (flags & RF24_TX_DF ? F (" passed" ) : F (" failed" ));
329
333
}
330
334
got_interrupt = false ; // reset this flag to prevent calling this function from loop()
331
335
wait_for_event = false ; // ready to continue with loop() operations
0 commit comments