1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-25 01:05:27 +03:00

Adjustments strings for OSD not kept in sync with enumeration causing invalid pointers

When the separate rc rates and rc expos for roll/pitch were added the descriptive names were never added to the OSD display strings array. Then later PID audio was added causing the array to be out of sync with the enumerated adjustment types.  This led to a corrupted pointer reference in the OSD display.

Also the adjustment display name used for the OSD display was never initialized so the pointer was pointing to random memory.

Removed the use of globals and changed to use "getter" functions.
This commit is contained in:
Bruce Luckcuck 2018-07-14 21:23:13 -04:00
parent b504a4869d
commit ef4a03507f
3 changed files with 26 additions and 7 deletions

View file

@ -944,7 +944,9 @@ static bool osdDrawSingleElement(uint8_t item)
#ifdef USE_OSD_ADJUSTMENTS
case OSD_ADJUSTMENT_RANGE:
tfp_sprintf(buff, "%s: %3d", adjustmentRangeName, adjustmentRangeValue);
if (getAdjustmentsRangeName()) {
tfp_sprintf(buff, "%s: %3d", getAdjustmentsRangeName(), getAdjustmentsRangeValue());
}
break;
#endif