EmuFlight
EmuFlight copied to clipboard
Import HDZero OSD Driver from iNav
Mostly from https://github.com/iNavFlight/inav/pull/7668/files commit
Notable changes:
- And added missing functions to bitarray.h/.c, msp_serial.h/.c
- Used baudRates[BAUD_115200] instead of baudRates[portConfig->peripheral_baudrateIndex]
Additional changes:
- serial: serialPortFunction_e now needs 32 bits
- Updated msp_protocol minor version to 52
How to use:
In CLI, Set FUNCTION_HDZERO_OSD to the appropriate serial port: Eg. Assuming to use serial port 4, enter the following CLI commands to enable FUNCTION_HDZERO_OSD in EmuFlight Configurator's CLI:
serial 3 65536 115200 115200 0 115200
save
HDZero has released firmware that works with this PR.
- https://www.hd-zero.com/document.
- Older firmware will be a corruption issue in EmuFlight due to VTX-Tables "BackPack" ~~This PR needs fixing to intercept MSP from backpack to prevent this.~~ done.
Known quirks to be attended before ready for master:
- OSD VTX elements not synchronized with HDZero hardware settings [non-breaking issue].
- DJI expects OSD elements in the 0-31,0-31 range (unpacked), where this PR is 0-63,0-63 (unpacked). e.g.
osd_crosshairs_pos = 2253notosd_crosshairs_pos = 8589.
Closes #700
- need to investigate "backpack" potentially the cause of MSP corruption
- ~~needs to intercept MSP for any old HDZero firmware that supports backpack.~~ done.
- otherwise, seems that everything works with HDZero's latest firmware.
- would prefer more testers testing it.

I assume this will then also work with https://github.com/fpv-wtf/msp-osd ?
I assume this will then also work with fpv-wtf/msp-osd ?
unknown; needs to be tested. Here are the HDZero builds:
- HDZero HEX dev-build https://github.com/emuflight/dev-unstable/releases/tag/hex-2365
- REQUIRES https://github.com/emuflight/dev-unstable/releases/tag/cfg-598
we request report/feedback on results.
edit: WTF.OS works, but need to set as PAL to align correctly. still need legacy_SD for legacy_DJI.
I think we need to fix the OSD canvas size because DJI goggles only support SD resolution. That's the reason we didn't merge this yet, because this is causing DJI osd to break.
@saidinesh5 , can you rebase on master?
https://github.com/iNavFlight/inav-configurator/blob/be88b5af8479d524089ef7a720c58b45c6026879/tabs/osd.js#L550
This needs work. I plan to take ownership. I really want to avoid MSP change for the uint32. betaflight stayed uint16.
edit: uint32 is fine. OSD bits will be reverted to 5bit, thanks to BF; https://github.com/emuflight/EmuFlight/pull/958