mirror of
https://github.com/hubaldv/bioz-firmware-rs.git
synced 2025-12-06 05:01:18 +00:00
Minor improvements
This commit is contained in:
@@ -230,12 +230,7 @@ const RCAL_VAL: f32 = 1000.0;
|
||||
|
||||
/// Convert raw 18-bit 2's complement value to signed i32
|
||||
fn sign_extend_18bit(val: u32) -> i32 {
|
||||
let masked = val & 0x3FFFF;
|
||||
if masked & (1 << 17) != 0 {
|
||||
(masked | 0xFFFC0000) as i32
|
||||
} else {
|
||||
masked as i32
|
||||
}
|
||||
((val << 14) as i32) >> 14
|
||||
}
|
||||
|
||||
/// Calculate magnitude and phase of Rz using Rcal reference
|
||||
|
||||
Reference in New Issue
Block a user