Skip to content

Commit

Permalink
Fix bug in which static payloads were broken
Browse files Browse the repository at this point in the history
  • Loading branch information
maniacbug committed Aug 2, 2011
1 parent 63eb62e commit af00a61
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions RF24.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ uint8_t RF24::write_payload(const void* buf, uint8_t len)
csn(LOW);
status = SPI.transfer( W_TX_PAYLOAD );
uint8_t data_len = min(len,payload_size);
//uint8_t blank_len = payload_size - data_len;
uint8_t blank_len = payload_size - data_len;
while ( data_len-- )
SPI.transfer(*current++);
//while ( blank_len-- )
// SPI.transfer(0);
while ( blank_len-- )
SPI.transfer(0);

csn(HIGH);

Expand All @@ -132,11 +132,11 @@ uint8_t RF24::read_payload(void* buf, uint8_t len)
csn(LOW);
status = SPI.transfer( R_RX_PAYLOAD );
uint8_t data_len = min(len,payload_size);
//uint8_t blank_len = payload_size - data_len;
uint8_t blank_len = payload_size - data_len;
while ( data_len-- )
*current++ = SPI.transfer(0xff);
//while ( blank_len-- )
// SPI.transfer(0xff);
while ( blank_len-- )
SPI.transfer(0xff);
csn(HIGH);

return status;
Expand Down

0 comments on commit af00a61

Please sign in to comment.