From 24378e5ecfb12857bc44bbcbeebf710ad4ab3692 Mon Sep 17 00:00:00 2001 From: Dennis Date: Sun, 16 Apr 2017 08:55:37 -0400 Subject: [PATCH 1/2] Make flush_rx public Since flush_rx was removed from startListening, this provides an option to flush the RX buffer in use cases where this is required. --- RF24.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/RF24.h b/RF24.h index 8a039ddab..9198b1d56 100644 --- a/RF24.h +++ b/RF24.h @@ -984,6 +984,13 @@ s * */ void openWritingPipe(uint64_t address); + /** + * Empty the receive buffer + * + * @return Current value of status register + */ + uint8_t flush_rx(void); + private: /** @@ -1074,13 +1081,6 @@ s * */ uint8_t read_payload(void* buf, uint8_t len); - /** - * Empty the receive buffer - * - * @return Current value of status register - */ - uint8_t flush_rx(void); - /** * Retrieve the current status of the chip * From 86f9b857b8a4b753a3685cdf51652827d759a236 Mon Sep 17 00:00:00 2001 From: Dennis Date: Mon, 15 May 2017 22:18:56 -0400 Subject: [PATCH 2/2] Fix for 4 wire mode on arduino The original #if was meaningless becasue it would always eveluate as true becasue LITTLEWIRE was already handled in an #elif above. This change allows the Tiny to still be able to use 3 wire mode, but arduinos can use a 4 wire mode, which uses CSN but not CE (CE always held high). Previously on an arduino if the CE and CSN pins were set to the same pin, then CSN pinmode was never set due to this IF --- RF24.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RF24.cpp b/RF24.cpp index 44a4ed3d1..cc108dced 100644 --- a/RF24.cpp +++ b/RF24.cpp @@ -613,7 +613,7 @@ bool RF24::begin(void) // Initialize pins if (ce_pin != csn_pin) pinMode(ce_pin,OUTPUT); - #if ! defined(LITTLEWIRE) + #if defined(RF24_TINY) if (ce_pin != csn_pin) #endif pinMode(csn_pin,OUTPUT);