1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 16:55:36 +03:00

Fixed inconsistency in OSD code. (#5223)

This commit is contained in:
Michael Keller 2018-03-04 11:43:46 +13:00 committed by GitHub
parent 37fa25606f
commit 6560e96e98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -387,7 +387,6 @@ static bool osdDrawSingleElement(uint8_t item)
uint8_t elemPosX = OSD_X(osdConfig()->item_pos[item]);
uint8_t elemPosY = OSD_Y(osdConfig()->item_pos[item]);
uint8_t elemOffsetX = 0;
char buff[OSD_ELEMENT_BUFFER_LENGTH];
switch (item) {
@ -500,22 +499,19 @@ static bool osdDrawSingleElement(uint8_t item)
case OSD_FLYMODE:
{
char *p = "ACRO";
if (isAirmodeActive()) {
p = "AIR ";
}
if (FLIGHT_MODE(FAILSAFE_MODE)) {
p = "!FS!";
strcpy(buff, "!FS!");
} else if (FLIGHT_MODE(ANGLE_MODE)) {
p = "STAB";
strcpy(buff, "STAB");
} else if (FLIGHT_MODE(HORIZON_MODE)) {
p = "HOR ";
strcpy(buff, "HOR ");
} else if (isAirmodeActive()) {
strcpy(buff, "AIR ");
} else {
strcpy(buff, "ACRO");
}
displayWrite(osdDisplayPort, elemPosX, elemPosY, p);
return true;
break;
}
case OSD_CRAFT_NAME:
@ -798,7 +794,7 @@ static bool osdDrawSingleElement(uint8_t item)
return false;
}
displayWrite(osdDisplayPort, elemPosX + elemOffsetX, elemPosY, buff);
displayWrite(osdDisplayPort, elemPosX, elemPosY, buff);
return true;
}