Skip to content

Commit

Permalink
Simplified logic of disableDynamicPayloads()
Browse files Browse the repository at this point in the history
Simplified logic of disableDynamicPayloads() - as in begin(), with reference to the product spec page 53, the reset values are 0.
  • Loading branch information
mattura authored and Avamander committed May 3, 2017
1 parent 706c1d6 commit 7eb704a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RF24.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ void RF24::disableDynamicPayloads(void)
// Disables dynamic payload throughout the system. Also disables Ack Payloads

//toggle_features();
write_register(FEATURE,read_register(FEATURE) & ~(_BV(EN_DPL) | _BV(EN_ACK_PAY)));
write_register(FEATURE, 0);


IF_SERIAL_DEBUG(printf("FEATURE=%i\r\n",read_register(FEATURE)));
Expand All @@ -1271,7 +1271,7 @@ void RF24::disableDynamicPayloads(void)
//
// Not sure the use case of only having dynamic payload on certain
// pipes, so the library does not support it.
write_register(DYNPD,read_register(DYNPD) & ~( _BV(DPL_P5) | _BV(DPL_P4) | _BV(DPL_P3) | _BV(DPL_P2) | _BV(DPL_P1) | _BV(DPL_P0)));
write_register(DYNPD, 0);

dynamic_payloads_enabled = false;
}
Expand Down

0 comments on commit 7eb704a

Please sign in to comment.