mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 21:35:44 +03:00
Show stopped motors in Motor Diagnostic OSD element
When motor is stopped and not spinning properly, show letter S instead of expected esc output. This is useful after crash recovery or during turtle mode.
This commit is contained in:
parent
de35df8e07
commit
17706e3b65
1 changed files with 8 additions and 0 deletions
|
@ -139,6 +139,8 @@
|
||||||
#define FULL_CIRCLE 360
|
#define FULL_CIRCLE 360
|
||||||
#define EFFICIENCY_MINIMUM_SPEED_CM_S 100
|
#define EFFICIENCY_MINIMUM_SPEED_CM_S 100
|
||||||
|
|
||||||
|
#define MOTOR_STOPPED_THRESHOLD_RPM 1000
|
||||||
|
|
||||||
#ifdef USE_OSD_STICK_OVERLAY
|
#ifdef USE_OSD_STICK_OVERLAY
|
||||||
typedef struct radioControls_s {
|
typedef struct radioControls_s {
|
||||||
uint8_t left_vertical;
|
uint8_t left_vertical;
|
||||||
|
@ -1051,6 +1053,12 @@ static void osdElementMotorDiagnostics(osdElementParms_t *element)
|
||||||
for (; i < getMotorCount(); i++) {
|
for (; i < getMotorCount(); i++) {
|
||||||
if (motorsRunning) {
|
if (motorsRunning) {
|
||||||
element->buff[i] = 0x88 - scaleRange(motor[i], getMotorOutputLow(), getMotorOutputHigh(), 0, 8);
|
element->buff[i] = 0x88 - scaleRange(motor[i], getMotorOutputLow(), getMotorOutputHigh(), 0, 8);
|
||||||
|
#if defined(USE_ESC_SENSOR) || defined(USE_DSHOT_TELEMETRY)
|
||||||
|
if (getEscRpm(i) < MOTOR_STOPPED_THRESHOLD_RPM) {
|
||||||
|
// Motor is not spinning properly. Mark as Stopped
|
||||||
|
element->buff[i] = 'S';
|
||||||
|
}
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
element->buff[i] = 0x88;
|
element->buff[i] = 0x88;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue