iNavFlight / inav

INAV: Navigation-enabled flight control software
https://inavflight.github.io
GNU General Public License v3.0
2.99k stars 1.43k forks source link

Support for SK6812 RGB+W LEDs #7862

Open jbienz opened 2 years ago

jbienz commented 2 years ago

Current Behavior

Only WS2811 LEDs are supported. No RGB + W lighting exists.

Desired Behavior

I'm very interested in seeing SK6812 LED support added to iNav. For those who aren't familiar, SK6812 is very close in protocol to WS2811 already supported, but SK6812 adds support for a dedicated white channel.

Here's a 2 minute video on why SK6812 is so awesome:

https://youtu.be/QnvircC22hU?t=720

Some of the main advantages of SK6812 over WS2811 are:

Code We Can Leverage

SK6812 support was added to Betaflight recently in December. The pull request is:

https://github.com/betaflight/betaflight/pull/10762

I pulled that branch of Betaflight and compared the changed files with the same ones in iNav. Unfortunately there were far more differences than I expected and I was not comfortable with trying to perform the merge myself.

image

Looking at the code, here are the changes made to Betaflight:

  1. LedStrip.md - Simple updates to documentation to mention SK6812 support.
  2. Settings.c - This is the configuration page for LEDs. The author added a new option in the drop-down to select RGB + White as the LED type.
  3. light_ws2811strip.c - Code was added to include white when calculating colors values if RGB + White is enabled.
  4. light_ws2811strip.h - Main changes here were to go from using 24-bit values for color to using 32-bit values (8 bits 3 colors + 8 bits 1 white).

What is Needed

I looked up the author of the Betaflight pull request (g3gg0) and unfortunately they're not a contributor to iNav. I have found an e-mail address for this individual and I plan to reach out, but they may not respond or may not be interested in iNav. I'm hoping a member of the iNav community could help migrate these Betaflight changes over to the iNav codebase.

@Linjieqiang and @Mluessi, I'm tagging the two of you because I noticed that you've contributed to both projects and are likely familiar with both codebases. @Martinbudden, I'm tagging you because I saw that in 2016 / 2017 you made some efforts to bring iNav up to date with changes from Betaflight.

If anyone is up for collaborating on this or even just taking it on, please let me know. And THANK YOU!

g3gg0 commented 2 years ago

Hi,

will have a look into it, but cannot promise.

Regards, g3gg0

jbienz commented 2 years ago

Hey @g3gg0, does it look like there might be any possibility of getting some assistance on this one? If not, I understand. Just trying to decide if I should wait or go for WS2811 to get the lights in my Night Timber working again.

g3gg0 commented 1 year ago

Did you have time to check the code, that I've sent you?

jbienz commented 1 year ago

Unfortunately this project got put on hold for me, but I do have everything you sent in my notebook for as soon as I'm able to resume it. Thank you sincerely @g3gg0.