magic fafo constant found

This commit is contained in:
Robert Schauklies 2026-03-14 18:23:11 +01:00
parent 0e97a15fab
commit 14a61d2f84

View file

@ -16,6 +16,7 @@ fn calculate_crc(frame: u16) -> u16 {
IFlight XING-E Pro 2207 2750KV IFlight XING-E Pro 2207 2750KV
*/ */
const XING_EPRO_22_POLES: u32 = 4; const XING_EPRO_22_POLES: u32 = 4;
const XING_EPRO_22_MAGNETS: u32 = 14;
#[allow(dead_code)] #[allow(dead_code)]
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
@ -322,8 +323,9 @@ impl<'a> DShot<'a> {
let period_ms: u32 = (mantissa << exp).into(); let period_ms: u32 = (mantissa << exp).into();
let erpm = (60 * 1_000_000) / period_ms; let erpm = (60 * 1_000_000) / period_ms;
let rpm = erpm/XING_EPRO_22_POLES; let rpm = erpm/(XING_EPRO_22_MAGNETS/2);
self.rpm.set(Some((rpm as f32 / 1.7) as _)) // let rpm = erpm/7;
self.rpm.set(Some((rpm as f32) as _))
} }
} }
} }