Mild cleanups

This commit is contained in:
Serge Bazanski 2026-02-28 23:12:05 +01:00
parent 9bce7f0416
commit 808b44b1f4

View file

@ -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))
}
}