From 399d219d6db589df449a56534d6327048915af87 Mon Sep 17 00:00:00 2001 From: TMRh20 Date: Mon, 18 Jul 2022 07:16:57 -0600 Subject: [PATCH] Fix for data corruption issues https://github.com/nRF24/RF24/issues/854 --- RF24.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RF24.cpp b/RF24.cpp index 7ce595080..0f8efa7a6 100644 --- a/RF24.cpp +++ b/RF24.cpp @@ -359,6 +359,7 @@ void RF24::write_payload(const void* buf, uint8_t data_len, const uint8_t writeT #if defined(RF24_SPI_PTR) status = _spi->transfer(writeType); while (data_len--) _spi->transfer(*current++); + while (blank_len--) _spi->transfer(0); #else // !defined(RF24_SPI_PTR) @@ -434,6 +435,7 @@ void RF24::read_payload(void* buf, uint8_t data_len) #else // !defined(RF24_SPI_PTR) status = _SPI.transfer(R_RX_PAYLOAD); while (data_len--) *current++ = _SPI.transfer(0xFF); + while (blank_len--) _SPI.transfer(0xff); #endif // !defined(RF24_SPI_PTR)