imxrt: dshot fix erpm calculation by implementing 3-bit exponent and 9-bit period

This commit is contained in:
Peter van der Perk
2024-05-30 04:56:42 -04:00
committed by David Sidrane
parent 3874b4c55d
commit ff6966da57
2 changed files with 24 additions and 10 deletions
+1 -2
View File
@@ -312,8 +312,7 @@ int DShot::handle_new_bdshot_erpm(void)
num_erpms++;
esc_status.esc_online_flags |= 1 << channel;
esc_status.esc[channel].timestamp = hrt_absolute_time();
esc_status.esc[channel].esc_rpm = (erpm * 100) /
(_param_mot_pole_count.get() / 2);
esc_status.esc[channel].esc_rpm = (erpm * 100) / (_param_mot_pole_count.get() / 2);
esc_status.esc[channel].actuator_function = _telemetry->actuator_functions[channel];
}