-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WS2812 support for ARM boards (planck rev6, preonic rev3) #6516
Conversation
Unfortunately, this is a duplicate of #6301. As that one already has some traction, my personal preference would be to go with that one. There are a few things in your branch that could be PRed separately though, like use of RGB matrix (however use of RGB matrix on underglow boards might not be the desired direction and maybe worth a chat on something like Discord). |
I wanted to preserve original commits by @jackhumbert, but if #6301 is going to be merged that's also fine. |
@@ -58,7 +58,7 @@ | |||
* The value one is not valid, timeouts are rounded up to | |||
* this value. | |||
*/ | |||
#define CH_CFG_ST_TIMEDELTA 2 | |||
#define CH_CFG_ST_TIMEDELTA 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may (does not) need to be changed if STM32_PWM_USE_TIM2
is set to false;
Or if STM32_ST_USE_TIMER
was changed to something other than 2.
@@ -58,7 +58,7 @@ | |||
* The value one is not valid, timeouts are rounded up to | |||
* this value. | |||
*/ | |||
#define CH_CFG_ST_TIMEDELTA 2 | |||
#define CH_CFG_ST_TIMEDELTA 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may (does not) need to be changed if STM32_PWM_USE_TIM2
is set to false;
Or if STM32_ST_USE_TIMER
was changed to something other than 2.
@drashna I reverted frequency and then i started playing a bit with timers and tick-less mode. I can't find working combination of timers so that RGB together with rest of the board's features work normally, this is basically the only working combination. Do you have any suggestion what to try? |
I'm waiting on some led's before i start testing with my boards. It may be possible to shift the timer/pwmd usage around to allow for this functionality without impacting ST. Another thing i would like to test is moving the slave timer from tim3 to TIM15|16|17. This challenge there is our version of PAL does not support anything above TIM8 so timer init and pwm control will need to be done at the register level. |
@chax you can try dumping the ST timer resolution down to 16 (CH_CFG_ST_RESOLUTION) in chconf.h and then changing ST to something other than 2 (i would suggest 4). Note that this still impacts performance but it should not be nearly as intrusive to function. |
That is my main concern, actually. |
That's actually the one that pulled me into messing with the led on the proton. If we're speaking of the olk boards, and current mainline capability, then TIM3 would be the non-intrusive choice. It should be relatively easy to move the slave timer in this implementation over to TIM1 with some changes to the dma assignments. |
I'm not sure where to continue this discussion so i'll just reply back here. I've mocked up an example using my working branch kratsyn:arm_ws2812-krats. The only build failure is on hadron/ver3 and it appears that is because of how i have wrapped the configuration. |
@kratsyn i tried your branch and leds don't work, also some letters are typed out double.
|
i'll have to dig further but i would guess it is the pwm writing those pins high when leddriverinit() is called. I figured that bit was problematic but this confirms it... |
Ws2812b are currently supported as both rgb matrix as well as for underglow as some people do use them for perkeyrgb |
@e11i0t23 I know ws2812 can be used for both RGB matrix and RGB light, however my comment was directed to the boards which have been converted within this PR. These are typical underglow boards, to which RGB matrix might be considered overkill, and/or just different and unexpected compared to the rest of the repo. |
Both configurations should be supportable once i wrap my head around the hsv<->rgb logic, I've synthesized an alternate solution that has less resource impact but it still needs to be fleshed out to work with the color conversion array. I'm also still waiting on my led's so any further testing will have to wait until they arrive. |
I should clarify that i do own a rev6 planck and a rev3 preonic so solving for the PR should be achievable. |
I have an alternative implementation working that only uses one dma channel and one timer. It will push an 8x8 grid and should default to olkb board settings. It is still a bit rough around the edges... you can find it on my repo in the arm_ws2812_alt branch. |
Looks like there are a number of merge conflicts here, now. Could you update the PR to resolve these? |
Feel free to review PR#6675 for an alternative implementation that does not consume 2 TIM devices and 3 DMA channels. |
Closing as requested. @chax, thank you for your efforts and contributions to this, all the same. |
Description
This is basically @jackhumbert's arm_rgb branch, merged with latest master branch, resolved all the conflicts and updated to use new format of rgb matrix (
led_config_t
).I've been using this branch for a long time with no problem on my planck. I've been regularly merging master and testing. In the end i created new clean branch and merged things in clean way.
I've been waiting for this feature (along with a lot of others who I've seen have been asking for it) to become officially supported by qmk firmware and merged in master branch. Since last update on original branch was several months ago, i decided to merge in latest master and open PR.
If this is already planned to be implemented in another way or @jackhumbert plans to update his branch on his own, then you can close this PR.
Types of Changes
Issues Fixed or Closed by This PR
Checklist