diff --git a/spinnyboy_rust/src/bin/dc_driver/dshot.rs b/spinnyboy_rust/src/bin/dc_driver/dshot.rs index a4fd8ff..7249a05 100644 --- a/spinnyboy_rust/src/bin/dc_driver/dshot.rs +++ b/spinnyboy_rust/src/bin/dc_driver/dshot.rs @@ -311,7 +311,7 @@ impl<'a> DShot<'a> { // Decode to a 16 bit value. if let Some(frame) = decode_bidi_telemetry(&buf[..len]) { // Check CRC. - let mut data = frame >> 4; + let data = frame >> 4; let crc = calculate_crc(data); if data != 0xfff && crc == (frame&0b1111) { // Fucking got it. @@ -322,7 +322,7 @@ impl<'a> DShot<'a> { let period_ms: u32 = (mantissa << exp).into(); let erpm = (60 * 1_000_000) / period_ms; - let rpm = (((erpm))/((XING_EPRO_22_POLES))); + let rpm = erpm/XING_EPRO_22_POLES; self.rpm.set(Some(rpm)) } }