Commit 5238ca25 authored by TMRh20's avatar TMRh20

#25 Fix CRC status, revert to default SPI lib

- Revert SPI to default lib by default. Configure via RF24_config.h #24
- Corrected CRC status reporting per https://github.com/evorios by
checking AA register
parent 56b7711e
......@@ -1292,9 +1292,11 @@ void RF24::setCRCLength(rf24_crclength_e length)
rf24_crclength_e RF24::getCRCLength(void)
{
rf24_crclength_e result = RF24_CRC_DISABLED;
uint8_t config = read_register(CONFIG) & ( _BV(CRCO) | _BV(EN_CRC)) ;
if ( config & _BV(EN_CRC ) )
uint8_t AA = read_register(EN_AA);
if ( config & _BV(EN_CRC ) || AA)
{
if ( config & _BV(CRCO) )
result = RF24_CRC_16;
......
......@@ -24,7 +24,7 @@
//#define FAILURE_HANDLING
//#define SERIAL_DEBUG
//#define MINIMAL
#define SPI_UART
//#define SPI_UART
//#define SOFTSPI
/**********************/
......
......@@ -1233,8 +1233,9 @@ rf24_crclength_e RF24::getCRCLength(void)
{
rf24_crclength_e result = RF24_CRC_DISABLED;
uint8_t config = read_register(CONFIG) & ( _BV(CRCO) | _BV(EN_CRC)) ;
if ( config & _BV(EN_CRC ) )
uint8_t AA = read_register(EN_AA);
if ( config & _BV(EN_CRC ) || AA)
{
if ( config & _BV(CRCO) )
result = RF24_CRC_16;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment