Skip to content

Commit

Permalink
Fix for data corruption issues
Browse files Browse the repository at this point in the history
  • Loading branch information
TMRh20 committed Jul 18, 2022
1 parent 54ce53a commit 399d219
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions RF24.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 399d219

Please sign in to comment.