Skip to content

Commit 762302f

Browse files
author
River MacLeod
committed
Fix SNR read.
It was giving wrong values, because the data from the radio is 2's compliment.
1 parent ab9b9ca commit 762302f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hal/src/subghz/packet_status.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ impl LoRaPacketStatus {
232232
/// assert_eq!(pkt_status.snr_pkt().to_integer(), 10);
233233
/// ```
234234
pub fn snr_pkt(&self) -> Ratio<i16> {
235-
Ratio::new_raw(i16::from(self.buf[2]), 4)
235+
Ratio::new_raw(i16::from(self.buf[2] as i8), 4)
236236
}
237237

238238
/// Estimation of RSSI level of the LoRa signal after despreading.

0 commit comments

Comments
 (0)