Fix bug introduced in the move to PROGMEM. Props to @basilrx for finding this. Also added a test case to demonstrate the bug, and guard against more like it in the future.

This commit is contained in:
maniacbug
2012-02-26 19:53:08 -08:00
parent f6e59b9de8
commit 2c97186329
3 changed files with 25 additions and 4 deletions

View File

@@ -649,7 +649,7 @@ void RF24::openReadingPipe(uint8_t child, uint64_t address)
// Note it would be more efficient to set all of the bits for all open
// pipes at once. However, I thought it would make the calling code
// more simple to do it this way.
write_register(EN_RXADDR,read_register(EN_RXADDR) | _BV(child_pipe_enable[child]));
write_register(EN_RXADDR,read_register(EN_RXADDR) | _BV(pgm_read_byte(&child_pipe_enable[child])));
}
}