EmuFlight icon indicating copy to clipboard operation
EmuFlight copied to clipboard

Import HDZero OSD Driver from iNav

Open saidinesh5 opened this issue 3 years ago • 6 comments

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 = 2253 not osd_crosshairs_pos = 8589.

Closes #700

saidinesh5 avatar Mar 17 '22 13:03 saidinesh5

  • need to investigate "backpack" potentially the cause of MSP corruption

nerdCopter avatar May 06 '22 18:05 nerdCopter

  • ~~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.

nerdCopter avatar Jun 23 '22 20:06 nerdCopter

image

nerdCopter avatar Sep 08 '22 14:09 nerdCopter

I assume this will then also work with https://github.com/fpv-wtf/msp-osd ?

SebastianKumor avatar Sep 28 '22 14:09 SebastianKumor

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.

nerdCopter avatar Sep 28 '22 14:09 nerdCopter

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 avatar Sep 28 '22 14:09 saidinesh5

@saidinesh5 , can you rebase on master?

nerdCopter avatar May 11 '23 18:05 nerdCopter

https://github.com/iNavFlight/inav-configurator/blob/be88b5af8479d524089ef7a720c58b45c6026879/tabs/osd.js#L550

nerdCopter avatar Nov 09 '23 21:11 nerdCopter

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

nerdCopter avatar Nov 09 '23 21:11 nerdCopter