diff --git a/src/modules/CC1101/CC1101.cpp b/src/modules/CC1101/CC1101.cpp index 264a23b4..dfe67bc2 100644 --- a/src/modules/CC1101/CC1101.cpp +++ b/src/modules/CC1101/CC1101.cpp @@ -17,7 +17,7 @@ int16_t CC1101::begin(float freq, float br, float freqDev, float rxBw, int8_t po bool flagFound = false; while((i < 10) && !flagFound) { uint8_t version = SPIreadRegister(CC1101_REG_VERSION); - if(version == 0x14) { + if((version == CC1101_VERSION_CURRENT) || (version == CC1101_VERSION_LEGACY)) { flagFound = true; } else { #ifdef RADIOLIB_DEBUG @@ -747,7 +747,7 @@ uint8_t CC1101::random() { // set mode to standby SPIsendCommand(CC1101_CMD_IDLE); - + return(randByte); } diff --git a/src/modules/CC1101/CC1101.h b/src/modules/CC1101/CC1101.h index 0d95a0ba..850df7ac 100644 --- a/src/modules/CC1101/CC1101.h +++ b/src/modules/CC1101/CC1101.h @@ -455,7 +455,8 @@ #define CC1101_PARTNUM 0x00 // CC1101_REG_VERSION -#define CC1101_VERSION 0x14 +#define CC1101_VERSION_CURRENT 0x14 +#define CC1101_VERSION_LEGACY 0x04 // CC1101_REG_MARCSTATE #define CC1101_MARC_STATE_SLEEP 0x00 // 4 0 main radio control state: sleep