Merge pull request #7104 from TonyBlit/motor_diag_idle

Motor diag showing low positions on idle
This commit is contained in:
Michael Keller 2018-11-23 01:37:34 +13:00 committed by GitHub
commit 3d0a59ea09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 7 deletions

View File

@ -689,18 +689,19 @@ static bool osdDrawSingleElement(uint8_t item)
}
case OSD_MOTOR_DIAG:
if(areMotorsRunning()) {
int maxIdx = 0;
{
int i = 0;
for(; i < getMotorCount(); i++) {
if(motor[i] > motor[maxIdx]) {
maxIdx = i;
const bool motorsRunning = areMotorsRunning();
for (; i < getMotorCount(); i++) {
if (motorsRunning) {
buff[i] = 0x88 - scaleRange(motor[i], motorOutputLow, motorOutputHigh, 0, 8);
} else {
buff[i] = 0x88;
}
buff[i] = 0x88 - scaleRange(motor[i], motorOutputLow, motorOutputHigh, 0, 8);
}
buff[i] = '\0';
break;
}
break;
case OSD_CRAFT_NAME:
// This does not strictly support iterative updating if the craft name changes at run time. But since the craft name is not supposed to be changing this should not matter, and blanking the entire length of the craft name string on update will make it impossible to configure elements to be displayed on the right hand side of the craft name.