Skip to content

Commit

Permalink
Fix: Static payload size bug prev introduced
Browse files Browse the repository at this point in the history
Introduced a bug by changing payload_size value to a static value of 32
and forgot to revert it. The commit was:

aac1650#diff-6dbdcee25d60de0476cb76000ce10fd3

Discovered due to #12 - Issue submitted by cbolanos79
  • Loading branch information
TMRh20 committed Aug 6, 2014
1 parent ecda0fa commit e8a63c0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions RF24.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ uint8_t RF24::write_payload(const void* buf, uint8_t data_len, const uint8_t wri
uint8_t status;
const uint8_t* current = reinterpret_cast<const uint8_t*>(buf);

if(data_len > 32) data_len = 32;
uint8_t blank_len = dynamic_payloads_enabled ? 0 : 32 - data_len;

data_len = min(data_len, payload_size);
uint8_t blank_len = dynamic_payloads_enabled ? 0 : payload_size - data_len;
//printf("[Writing %u bytes %u blanks]",data_len,blank_len);

#if defined (__arm__) && !defined ( CORE_TEENSY )
Expand Down Expand Up @@ -189,8 +189,8 @@ uint8_t RF24::read_payload(void* buf, uint8_t data_len)
uint8_t* current = reinterpret_cast<uint8_t*>(buf);

if(data_len > payload_size) data_len = payload_size;
uint8_t blank_len = dynamic_payloads_enabled ? 0 : 32 - data_len;

uint8_t blank_len = dynamic_payloads_enabled ? 0 : payload_size - data_len;
//printf("[Reading %u bytes %u blanks]",data_len,blank_len);


Expand Down

0 comments on commit e8a63c0

Please sign in to comment.