Maniacbug RF24 on Nucleo STM32
Dependents: NRF24_master_slave NRF24_master_slave
Diff: RF24.cpp
- Revision:
- 4:baf3b07be1a7
- Parent:
- 3:af425ff47d9f
- Child:
- 5:aaff7f374e2b
--- a/RF24.cpp Thu Jan 22 00:00:49 2015 +0000 +++ b/RF24.cpp Thu Feb 05 01:24:17 2015 +0000 @@ -565,6 +565,21 @@ bool RF24::available(uint8_t* pipe_num) { + // tmr20h's code + if (!( read_register(FIFO_STATUS) & _BV(RX_EMPTY) )) { + + // If the caller wants the pipe number, include that + if ( pipe_num ) { + uint8_t status = get_status(); + *pipe_num = ( status >> RX_P_NO ) & 7; + } + return 1; + } + + + return 0; + + /* // Maniacbug's code uint8_t status = get_status(); // Too noisy, enable if you really want lots o data!! @@ -591,6 +606,7 @@ } return result; + */ } /****************************************************************************/