Skip to content

Commit

Permalink
[SX126x] Fix instant RSSI reading
Browse files Browse the repository at this point in the history
  • Loading branch information
jgromes committed Sep 25, 2024
1 parent da74aa2 commit af27e44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/SX126x/SX126x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1260,9 +1260,9 @@ float SX126x::getRSSI(bool packet) {
return(-1.0 * rssiPkt/2.0);
} else {
// get instantaneous RSSI value
uint8_t data[3] = {0, 0, 0}; // RssiInst, Status, RFU
this->mod->SPIreadStream(RADIOLIB_SX126X_CMD_GET_RSSI_INST, data, 3);
return((float)data[0] / (-2.0));
uint8_t rssiRaw = 0;
this->mod->SPIreadStream(RADIOLIB_SX126X_CMD_GET_RSSI_INST, &rssiRaw, 1);
return((float)rssiRaw / (-2.0));
}
}

Expand Down

0 comments on commit af27e44

Please sign in to comment.