-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Description
https://github.com/iNavFlight/inav/blob/master/src/main/telemetry/srxl.c#L187
Inav does not contain USE_ESC_SENSOR_TELEMETRY neither USE_DSHOT_TELEMETRY, neither getEscSensorData(ESC_SENSOR_COMBINED); Probably acidently compied from betaflight, https://github.com/betaflight/betaflight/blob/master/src/main/sensors/esc_sensor.c#L155
If nobody complained about it probably we can remove it, or fix it, unfortunately I don't have any spectrum device.
uint16_t getMotorAveragePeriod(void)
{
#if defined( USE_ESC_SENSOR_TELEMETRY) || defined( USE_DSHOT_TELEMETRY)
uint32_t rpm = 0;
uint16_t period_us = SPEKTRUM_RPM_UNUSED;
#if defined( USE_ESC_SENSOR_TELEMETRY)
escSensorData_t *escData = getEscSensorData(ESC_SENSOR_COMBINED);
if (escData != NULL) {
rpm = escData->rpm;
}
#endif
#if defined(USE_DSHOT_TELEMETRY)
if (useDshotTelemetry) {
uint16_t motors = getMotorCount();
if (motors > 0) {
for (int motor = 0; motor < motors; motor++) {
rpm += getDshotTelemetry(motor);
}
rpm = 100.0f / (motorConfig()->motorPoleCount / 2.0f) * rpm; // convert erpm freq to RPM.
rpm /= motors; // Average combined rpm
}
}
#endif
if (rpm > SPEKTRUM_MIN_RPM && rpm < SPEKTRUM_MAX_RPM) {
period_us = MICROSEC_PER_MINUTE / rpm; // revs/minute -> microSeconds
} else {
period_us = MICROSEC_PER_MINUTE / SPEKTRUM_MIN_RPM;
}
return period_us;
#else
return SPEKTRUM_RPM_UNUSED;
#endif
}
`Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels