-
-
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
Add support for ISSI drivers on both sides of a split keyboard #13842
Conversation
Could this also be applied to the LED Matrix code? |
Probably. The two codebases seem quite similar. |
They are. Intentionally. Also, is this dependent on i2c communication, can it be used with serial? |
This diff assumes serial as split protocol. Before this diff, RGB_SPLIT allowed the slave side to control I2C for ws2812 LEDs. This diff only extends the indexing functionality. For I2C split protocol, I think the recent dual driver diff would make a split RGB keyboard work. |
Okay, just wanted to make sure. |
Some more gotchas:
|
quantum/rgb_matrix/rgb_matrix.h
Outdated
@@ -213,6 +232,17 @@ typedef struct { | |||
void (*flush)(void); | |||
} rgb_matrix_driver_t; | |||
|
|||
#if defined(RGB_MATRIX_SPLIT) | |||
# define RGB_MATRIX_FINISHED_ALL_LEDS \ |
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 might be better as a function rather than a define, to keep filesize down (especially on AVR...)
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.
Couple of potential issues. One is that the function definition changes depending on the define (it may or may not need k_rgb_matrix_split). Not sure how to go around that.
Second issue is that I don't know if inlining would work, if performance (over file size) is desired.
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.
I'm pretty sure something like this would work fine:
bool rgb_matrix_finished_all_leds(void) {
#if defined(RGB_MATRIX_SPLIT)
if (is_keyboard_left()) {
return led_max < k_rgb_matrix_split[0];
} else {
return led_max < DRIVER_LED_TOTAL;
}
#else
return led_max < DRIVER_LED_TOTAL;
#endif
}
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.
Updated.
For the docs, it would also be worth noting if both sides need to use the same address, or different addresses for the ISSI controller, and the like. |
I can apply the changes to the LED matrix code as well (to avoid code divergence), but I don't know how to test it. |
There are a few of us with ergodox infinity's that can test it out, actually. IIRC, @fauxpark does, as do I. |
I don't, actually, just one of these: https://learn.adafruit.com/i31fl3731-16x9-charliplexed-pwm-led-driver |
Compiling with ws2812:
|
Hm, what was your compile command (keyboard)? So that I can replicate. |
It's the crkbd. Make sure you compile with my keymap. It doesn't have rgb matrix enabled by default, but it is enabled on mine. |
Just pushed a fix. It now compiles with the default keymap + RGB_SPLIT_ENABLE. I wasn't sure which keymap was yours; still not fully confident in the WS2812 logic either. |
My keymap isn't actually in the crkbd folder, it's in a community layout, but it's And yeah, that seems to fix it. And can verify that it works on the corne. Will probably test on the infinity later this week. |
Nice. Out of curiosity, if you had RGB_ENABLE before, what was the behavior before this diff? Or did you have custom code for that? Infinity -> I haven't applied the changes to the led_matrix code. |
I can also test on Infinity if needed. However, sorry if I'm being dense, but I don't really understand (or see) what this does in comparison with the existing |
It looks like Ergodox Infinity is currently using custom code in conjunction with LED_MATRIX_SPLIT. The diff allows for 1) no custom code 2) not just symmetric keyboards 3) having proper animations, vs symmetric brightness values on both sides. |
What are you referring to? I ported Ergodox Infinity to led_matrix, and I don't remember writing any such custom code. 😛 Also, I have working animations that are running waves and ripples etc. across both halves, not just symmetric ones... That said, allowing for non-symmetric keyboards sounds like a nice feature. 😃 |
Custom code - fair enough. Non-symmetric brightness - maybe I'm just remembering the middle stages of trying to get it to work for my non-symmetrical keyboard. The idea is to have g_is31_leds specify parameters for all LEDs on both sides of the board, and to fetch the correct one. |
Thank you for your contribution! |
… small tweak to re-enable WS2812
8eb18f2
to
2b2bdc1
Compare
Co-authored-by: Ryan <fauxpark@gmail.com>
b9e4940
to
4937eeb
Compare
…3842) * Gets RGB working on a split keyboard with IS31FL3733. Currently needs small tweak to re-enable WS2812 * Added helper function * Trying to integrate the function * Moved functionality into a macro * Swapped conditional for a macro everywhere * Tidying up * More code cleanup * Documentation updates * Fixed formatting via linter * Switching to a function from a macro * Fixed compile error * Fixing WS2812 behavior. UNTESTED. * Updated documentation about the driver addresses. * Fixed code for WS2812 * Trying to add in LED_MATRIX support * Updated effects for LED matrix * Updated third-party effect defines. * Ran format-c on modified files * Apply suggestions from code review Co-authored-by: Ryan <fauxpark@gmail.com> * Move to static inline. Avoids issues with gcc v8+ * Move helper function for LED_matrix to static inline to avoid issues with gcc v8+ Co-authored-by: Vlad Kvitnevskiy <vladkvit@outlook.com> Co-authored-by: Ryan <fauxpark@gmail.com>
When a split keyboard has a driver (such as the IS31FL3733) on each side of the split, this diff allows for full RGB animation support on both sides.
Description
Gotchas. This touches the "rgb_matrix" code and not the "led_matrix" code.
I tested this on my own split keyboard with a driver per side.
Types of Changes
Issues Fixed or Closed by This PR
Checklist