[RFM9x] Added 0x12 as valid device ID
This commit is contained in:
parent
56dd0ab41d
commit
3a15335b59
4 changed files with 22 additions and 6 deletions
|
@ -6,8 +6,15 @@ RFM95::RFM95(Module* mod) : SX1278(mod) {
|
|||
|
||||
int16_t RFM95::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, int8_t power, uint8_t currentLimit, uint16_t preambleLength, uint8_t gain) {
|
||||
// execute common part
|
||||
int16_t state = SX127x::begin(RFM95_CHIP_VERSION, syncWord, currentLimit, preambleLength);
|
||||
RADIOLIB_ASSERT(state);
|
||||
int16_t state = SX127x::begin(RFM9X_CHIP_VERSION_OFFICIAL, syncWord, currentLimit, preambleLength);
|
||||
if(state == ERR_CHIP_NOT_FOUND) {
|
||||
// SX127X_REG_VERSION might be set 0x12
|
||||
state = SX127x::begin(RFM9X_CHIP_VERSION_UNOFFICIAL, syncWord, currentLimit, preambleLength);
|
||||
RADIOLIB_ASSERT(state);
|
||||
} else if(state != ERR_NONE) {
|
||||
// some other error
|
||||
return(state);
|
||||
}
|
||||
|
||||
// configure settings not accessible by API
|
||||
state = config();
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
#include "../SX127x/SX1278.h"
|
||||
|
||||
// SX127X_REG_VERSION
|
||||
#define RFM95_CHIP_VERSION 0x11
|
||||
#define RFM9X_CHIP_VERSION_OFFICIAL 0x11
|
||||
#define RFM9X_CHIP_VERSION_UNOFFICIAL 0x12 // according to datasheet, only 0x11 should be possible, but some modules seem to have 0x12
|
||||
|
||||
/*!
|
||||
\class RFM95
|
||||
|
|
|
@ -6,8 +6,15 @@ RFM96::RFM96(Module* mod) : SX1278(mod) {
|
|||
|
||||
int16_t RFM96::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, int8_t power, uint8_t currentLimit, uint16_t preambleLength, uint8_t gain) {
|
||||
// execute common part
|
||||
int16_t state = SX127x::begin(RFM9X_CHIP_VERSION, syncWord, currentLimit, preambleLength);
|
||||
RADIOLIB_ASSERT(state);
|
||||
int16_t state = SX127x::begin(RFM9X_CHIP_VERSION_OFFICIAL, syncWord, currentLimit, preambleLength);
|
||||
if(state == ERR_CHIP_NOT_FOUND) {
|
||||
// SX127X_REG_VERSION might be set 0x12
|
||||
state = SX127x::begin(RFM9X_CHIP_VERSION_UNOFFICIAL, syncWord, currentLimit, preambleLength);
|
||||
RADIOLIB_ASSERT(state);
|
||||
} else if(state != ERR_NONE) {
|
||||
// some other error
|
||||
return(state);
|
||||
}
|
||||
|
||||
// configure settings not accessible by API
|
||||
state = config();
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
#include "../SX127x/SX1278.h"
|
||||
|
||||
// SX127X_REG_VERSION
|
||||
#define RFM9X_CHIP_VERSION 0x12 // according to datasheet, this should be 0x11, but all modules seem to have 0x12
|
||||
#define RFM9X_CHIP_VERSION_OFFICIAL 0x11
|
||||
#define RFM9X_CHIP_VERSION_UNOFFICIAL 0x12 // according to datasheet, only 0x11 should be possible, but some modules seem to have 0x12
|
||||
|
||||
/*!
|
||||
\class RFM96
|
||||
|
|
Loading…
Add table
Reference in a new issue