Skip to content

Commit

Permalink
use read_register() instead of isFifo()
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Aug 14, 2023
1 parent 6db47d6 commit 2e1d682
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions RF24.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1529,15 +1529,15 @@ bool RF24::available(void)

bool RF24::available(uint8_t* pipe_num)
{
if (!isFifo(false, true)) { // if RX FIFO is not empty
// If the caller wants the pipe number, include that
if (*pipe_num != RF24_NO_FETCH_PIPE)
*pipe_num = (get_status() >> RX_P_NO) & 0x07;

return 1;
if (read_register(FIFO_STATUS) & 1) { // if RX FIFO is empty
return 0;
}

return 0;
// If the caller wants the pipe number, include that
if (*pipe_num != RF24_NO_FETCH_PIPE)
*pipe_num = (get_status() >> RX_P_NO) & 0x07;

return 1;
}

/****************************************************************************/
Expand Down

0 comments on commit 2e1d682

Please sign in to comment.