1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-12 19:10:32 +03:00

Fix osd_esc_rpm_alarm (#14361)

* Fix osd_esc_rpm_alarm

* Should be >= ???

* Add edt condition to pass

* Revert 349
This commit is contained in:
Mark Haslinghuis 2025-05-15 22:51:29 +02:00 committed by GitHub
parent b845d6dfd8
commit 7d88e7d27f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -336,11 +336,6 @@ void renderOsdWarning(char *warningText, bool *blinking, uint8_t *displayAttr)
warningText[dshotEscErrorLength++] = 'C';
for (uint8_t k = 0; k < getMotorCount(); k++) {
// Skip if no extended telemetry at all
if ((dshotTelemetryState.motorState[k].telemetryTypes & DSHOT_EXTENDED_TELEMETRY_MASK) == 0) {
continue;
}
// Remember text index before writing warnings
dshotEscErrorLengthMotorBegin = dshotEscErrorLength;
@ -354,12 +349,16 @@ void renderOsdWarning(char *warningText, bool *blinking, uint8_t *displayAttr)
&& (dshotTelemetryState.motorState[k].telemetryData[DSHOT_TELEMETRY_TYPE_eRPM] * 100 * 2 / motorConfig()->motorPoleCount) <= osdConfig()->esc_rpm_alarm) {
warningText[dshotEscErrorLength++] = 'R';
}
if (osdConfig()->esc_temp_alarm != ESC_TEMP_ALARM_OFF
// Skip if no extended telemetry available
bool edt = (dshotTelemetryState.motorState[k].telemetryTypes & DSHOT_EXTENDED_TELEMETRY_MASK) != 0;
if (edt && osdConfig()->esc_temp_alarm != ESC_TEMP_ALARM_OFF
&& (dshotTelemetryState.motorState[k].telemetryTypes & (1 << DSHOT_TELEMETRY_TYPE_TEMPERATURE)) != 0
&& dshotTelemetryState.motorState[k].telemetryData[DSHOT_TELEMETRY_TYPE_TEMPERATURE] >= osdConfig()->esc_temp_alarm) {
warningText[dshotEscErrorLength++] = 'T';
}
if (osdConfig()->esc_current_alarm != ESC_CURRENT_ALARM_OFF
if (edt && osdConfig()->esc_current_alarm != ESC_CURRENT_ALARM_OFF
&& (dshotTelemetryState.motorState[k].telemetryTypes & (1 << DSHOT_TELEMETRY_TYPE_CURRENT)) != 0
&& dshotTelemetryState.motorState[k].telemetryData[DSHOT_TELEMETRY_TYPE_CURRENT] >= osdConfig()->esc_current_alarm) {
warningText[dshotEscErrorLength++] = 'C';