[CC1101] Added 0x04 as valid version register value (#183)

This commit is contained in:
jgromes 2020-09-19 19:48:21 +02:00
parent 35f02ed402
commit cd142df4b9
2 changed files with 4 additions and 3 deletions

View file

@ -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);
}

View file

@ -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