Restore explicit resolutionType_e wire values for DJI WTFOS OSD - #11788
Restore explicit resolutionType_e wire values for DJI WTFOS OSD#11788sensei-hacker wants to merge 3 commits into
Conversation
Removing HD_3016 from the enum in commit 7ec7f0d (PR iNavFlight#10540) shifted every later member's implicit ordinal down by one, so currentOsdMode now sends HD_6022 as wire value 2 instead of 3. WTFOS goggles/VTX firmware hardcodes 3 for its 60x22 mode, so the OSD canvas renders shifted. Fixes iNavFlight#11764
PR Summary by QodoFix DJI WTFOS OSD shift by pinning MSP DisplayPort resolution wire values
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1.
|
Keep the published protocol reference in sync with the corrected wire values for resolutionType_e.
|
Test firmware build ready — commit Download firmware for PR #11788 244 targets built. Find your board's
|
Run the actual generator instead of hand-editing, so the docs match gen_docs.sh output exactly and pick up other enums that had drifted since these files were last regenerated.
Summary
Fixes a 9.1.0 regression where the DJI WTFOS (Caddx Vista/DJI Air Unit + DJI Goggles) MSP DisplayPort OSD renders globally shifted relative to the video frame.
Root Cause
Commit 7ec7f0d (PR #10540, "Remove HD_3016 from resolutionType_e enum") removed
HD_3016from the middle of theresolutionType_eenum, which had no explicit values. That shifted every later member's implicit ordinal down by one:HD_6022(the DJI WTFOS 60x22 mode) went from wire value 3 to wire value 2.currentOsdModeis sent as a raw byte in theMSP_DP_OPTIONSMSP DisplayPort subcommand. WTFOS goggles/VTX firmware hardcodes wire value 3 for its 60x22 mode, so it now misinterprets the byte INAV sends, producing the reported canvas misalignment.Changes
src/main/io/displayport_msp_osd.c: giveresolutionType_eexplicit values, restoringHD_6022 = 3(andHD_5320 = 4,HD_3016 = 2as an intentional unused placeholder to hold the ordinal). Added a comment noting these are wire-protocol constants that must stay fixed.Testing
src/main) depends on the enum's ordinal values via arithmetic, comparison, or indexing —currentOsdModeis only ever assigned by name and serialized as a raw byte, so this change is safe.inav-configuratorhas no hardcoded copy of these wire values to keep in sync.Testing Required; would appreciate confirmation from a WTFOS/Vista user (e.g. from the issue thread) that OSD alignment is restored to 9.0.1/8.0.1 behavior.Code Review
Reviewed with the project's automated code-review process — no critical or important issues found.
Related Issues
Fixes #11764
Credit to the community members who diagnosed the root cause on the issue thread (b14ckyy, daijoubu).