jpbarraca / pynrf24

Python port of the RF24 library for NRF24L01+ radios.
GNU General Public License v2.0
152 stars 84 forks source link

setCRCLength(NRF24.CRC_8) sets PWR_UP bit in CONFIG register #19

Closed dquadros closed 8 years ago

dquadros commented 8 years ago

From the datasheet: bit 3 is EN_CRC (1 enables, 0 disables), bit 2 is CRCO (0 for 8 bits, 1 for 16 bits). bit 1 is PWR_UP

From nrf24.py: CRC_DISABLED = 0x0 CRC_8 = 0x02 CRC_16 = 0x04 CRC_ENABLED = 0x08

CONFIG register after setCRCLength(NRF24.CRC_8): xxxx101x

Quick fix: remove config |= NRF24.CRC_8 from setCRCLength() Better fix: use NRF24.CRCO and NRF24.EN_CRC for acessing CONFIG bits instead of NRF24.CRC_xxxx, as in getCRCLength()

jpbarraca commented 8 years ago

Thanks for the find. Corrected.