Tidied up EN_RXADDR setting

This commit is contained in:
maniacbug 2011-06-28 06:56:24 -07:00
parent 8701d82615
commit c151ffbf67
1 changed files with 4 additions and 6 deletions

View File

@ -523,12 +523,10 @@ void RF24::openReadingPipe(uint8_t child, uint64_t value)
write_register(child_payload_size[child],payload_size); write_register(child_payload_size[child],payload_size);
// Note this is kind of an inefficient way to set up these enable bits, bit I thought it made // Note it would be more efficient to set all of the bits for all open
// the calling code more simple // pipes at once. However, I thought it would make the calling code
uint8_t en_rx; // more simple to do it this way.
read_register(EN_RXADDR,&en_rx,1); write_register(EN_RXADDR,read_register(EN_RXADDR) | _BV(child_pipe_enable[child]));
en_rx |= _BV(child_pipe_enable[child]);
write_register(EN_RXADDR,en_rx);
} }
} }