Skip to content

Commit

Permalink
Added mode change to getRSSI
Browse files Browse the repository at this point in the history
  • Loading branch information
jgromes committed Nov 2, 2019
1 parent a3d49a4 commit 48cf1c7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
13 changes: 11 additions & 2 deletions src/modules/SX1272.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,17 @@ float SX1272::getRSSI() {
return(lastPacketRSSI);

} else {
// just read the value for FSK
return((float)_mod->SPIgetRegValue(SX127X_REG_RSSI_VALUE) / 2.0);
// enable listen mode
startReceive();

// read the value for FSK
float rssi = (float)_mod->SPIgetRegValue(SX127X_REG_RSSI_VALUE_FSK) / -2.0;

// set mode back to standby
standby();

// return the value
return(rssi);
}
}

Expand Down
13 changes: 11 additions & 2 deletions src/modules/SX1278.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,17 @@ float SX1278::getRSSI() {
return(lastPacketRSSI);

} else {
// just read the value for FSK
return((float)_mod->SPIgetRegValue(SX127X_REG_RSSI_VALUE) / 2.0);
// enable listen mode
startReceive();

// read the value for FSK
float rssi = (float)_mod->SPIgetRegValue(SX127X_REG_RSSI_VALUE_FSK) / -2.0;

// set mode back to standby
standby();

// return the value
return(rssi);
}
}

Expand Down

0 comments on commit 48cf1c7

Please sign in to comment.