From 2e1d6826ca369c5de63513f74ff9d7405a3d4466 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Mon, 14 Aug 2023 03:29:38 -0700 Subject: [PATCH] use read_register() instead of isFifo() --- RF24.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/RF24.cpp b/RF24.cpp index 4d92aeba..9e5b4a83 100644 --- a/RF24.cpp +++ b/RF24.cpp @@ -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; } /****************************************************************************/