Fixed SX1272 address generation and version check
This commit is contained in:
parent
9ee5b1b30c
commit
b451363025
1 changed files with 7 additions and 1 deletions
|
@ -54,7 +54,7 @@ uint8_t SX1272::begin(Bandwidth bw, SpreadingFactor sf, CodingRate cr, uint16_t
|
||||||
bool flagFound = false;
|
bool flagFound = false;
|
||||||
while((i < 10) && !flagFound) {
|
while((i < 10) && !flagFound) {
|
||||||
uint8_t version = _mod->SPIreadRegister(SX1272_REG_VERSION);
|
uint8_t version = _mod->SPIreadRegister(SX1272_REG_VERSION);
|
||||||
if(version == 0x12) {
|
if(version == 0x22) {
|
||||||
flagFound = true;
|
flagFound = true;
|
||||||
} else {
|
} else {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -212,6 +212,12 @@ uint8_t SX1272::setCodingRate(CodingRate cr) {
|
||||||
return(state);
|
return(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SX1272::generateLoRaAdress() {
|
||||||
|
for(uint8_t i = _addrEeprom; i < (_addrEeprom + 8); i++) {
|
||||||
|
EEPROM.write(i, (uint8_t)random(0, 256));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t SX1272::config(Bandwidth bw, SpreadingFactor sf, CodingRate cr) {
|
uint8_t SX1272::config(Bandwidth bw, SpreadingFactor sf, CodingRate cr) {
|
||||||
uint8_t status = ERR_NONE;
|
uint8_t status = ERR_NONE;
|
||||||
uint8_t newBandwidth, newSpreadingFactor, newCodingRate;
|
uint8_t newBandwidth, newSpreadingFactor, newCodingRate;
|
||||||
|
|
Loading…
Add table
Reference in a new issue