Skip to content

Commit

Permalink
writeAckPayload does not need to check for static payload size
Browse files Browse the repository at this point in the history
When writing an ACK payload to TX FIFO, static payload size is not applicable.
So, bypass the additional checks in `write_payload()` about ensuring static payload size is satisfied.

Note, the `W_ACK_PAYLOAD` command already has 0x20 bit (`W_REGISTER`) asserted.
  • Loading branch information
2bndy5 committed Jul 15, 2024
1 parent ba12195 commit 7abc73d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion RF24.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1756,7 +1756,7 @@ bool RF24::writeAckPayload(uint8_t pipe, const void* buf, uint8_t len)
if (ack_payloads_enabled) {
const uint8_t* current = reinterpret_cast<const uint8_t*>(buf);

write_payload(current, len, W_ACK_PAYLOAD | (pipe & 0x07));
write_register(W_ACK_PAYLOAD | (pipe & 0x07), current, rf24_min(len, static_cast<uint8_t>(32)));
return !(status & _BV(TX_FULL));
}
return 0;
Expand Down

0 comments on commit 7abc73d

Please sign in to comment.