msp_osd: reuse existing mode name conversion #22514
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solved Problem
When having a first look at the OSD code I found that all the modes names are explicitly defined again. This is also done in the corssfire driver and analog OSD for a long time already. I might fix those when I have things ready to test next.
Solution
Reuse the existing mode utility
nav_state_names[]
string definitions.This saves a bit of flash, keeps the mode names up to date and works like expected.
Changelog Entry
Test coverage
I finally assembled the hardware to fly and test the digital FPV system. Here are potato pictures of me switching through the modes. It works great, still only shows the 3 first letters but we can improve that later once I understand all the limitations.