Skip to content

Commit 6e8caf3

Browse files
anmRiver MacLeodnewAM
authored
Fix SNR read. (#384)
* Fix SNR read. It was giving wrong values, because the data from the radio is 2's compliment. * Add changelog entry --------- Co-authored-by: River MacLeod <[email protected]> Co-authored-by: Alex Martens <[email protected]>
1 parent 70ba3ac commit 6e8caf3

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Added
9+
- Added a missing `must_use` in `SleepCfg::set_startup`.
10+
811
### Changed
9-
- Renamed function TcxoMode::set_txco_trim() to TcxoMode::set_tcxo_trim() to correct spelling.
10-
- Renamed enum CmdStatus::Avaliable to CmdStatus::Available to correct spelling.
1112
- Updated minimum `chrono` version to `0.4.23` to satisfy `cargo-audit`.
1213
- Changed the edition from 2021 to 2024.
1314
- Changed minimum supported rust version from 1.60 to 1.85.
1415

1516
### Fixed
16-
- Added a missing `must_use` in `SleepCfg::set_startup`.
17+
- Fixed an incorrect cast from `u8` to `i16` in `LoRaPacketStatus::snr_pkt`
18+
- Renamed function `TcxoMode::set_txco_trim` to `TcxoMode::set_tcxo_trim` to fix spelling.
19+
- Renamed enum `CmdStatus::Avaliable` to `CmdStatus::Available` to fix spelling.
1720

1821
## [0.6.1] - 2022-08-01
1922
### Fixed

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)