Skip to content
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

Change split_common to use RGBLIGHT_SPLIT #5509

Merged
merged 24 commits into from
Apr 19, 2019

Conversation

mtei
Copy link
Contributor

@mtei mtei commented Mar 29, 2019

This PR needs to merge #5020 first.

If you want to test the behavior of this PR, please temporarily cherry pick 647c0a9.

Description

Change split_common to synchronize rgblight using RGBLIGHT_SPLIT.

  • When using I2C master-slave communication
    Enabling rgblight implicitly also enables RGBLIGHT_SPLIT.
    (see quantum quantum/split_common/post_config.h)
  • When using serial master-slave communication
    Enabling rgblight does not enable RGBLIGHT_SPLIT.
    If necessary, define RGBLIGHT_SPLIT in config.h of the keyboard.
    (see quantum quantum/split_common/post_config.h)

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

mtei added 11 commits March 29, 2019 16:00
Improvements to ease the maintenance of the I2C slave buffer layout. And this commit does not change the compilation results.
add new version(qmk#5020) quantum/rgblight.[ch], quantum/rgblight_modes.h
Add quantum/rgblight_post_config.h and quantum/split_common/post_config.h using POST_CONFIG_H variable of build_keyboard.mk.

quantum/rgblight_post_config.h additionally defines RGBLIGHT_SPLIT if RGBLED_SPIT is defined.

quantum/split_common/post_config.h defines RGBLIGHT_SPLIT additionally when master-slave communication is I2C.
This reverts commit 80118a6.

[x] make RGBLIGHT_TEST=1 handwired/pdhelix/i2c:default
[x] make RGBLIGHT_TEST=2 handwired/pdhelix/i2c:default (same RGBLIGHT_TEST=3)
[x] make RGBLIGHT_TEST=3 handwired/pdhelix/i2c:default

[x] make RGBLIGHT_TEST=1 handwired/pdhelix/pd2:default
[x] make RGBLIGHT_TEST=2 handwired/pdhelix/pd2:default
[x] make RGBLIGHT_TEST=3 handwired/pdhelix/pd2:default

[x] make RGBLIGHT_TEST=1 handwired/pdhelix/pd2_2oled:default
[x] make RGBLIGHT_TEST=2 handwired/pdhelix/pd2_2oled:default
[x] make RGBLIGHT_TEST=3 handwired/pdhelix/pd2_2oled:default
…ci test.

add new version(qmk#5020) quantum/rgblight.[ch], quantum/rgblight_modes.h
 to see if it passes the travis-ci test."

This reverts commit 647c0a9.
docs/config_options.md Outdated Show resolved Hide resolved
@Lenbok
Copy link
Contributor

Lenbok commented Apr 3, 2019

@mtei It looks like some of the split keyboards are failing to build in travis. If this is otherwise ready for testing I can give this a whirl this weekend on my redox.

@mtei
Copy link
Contributor Author

mtei commented Apr 3, 2019

@Lenbok You can try checkout 647c0a9. I think it is work well.

@drashna
Copy link
Member

drashna commented Apr 3, 2019

Yeah, I think that this PR depends on #5020 to be merged first. So without that, this one may fail.
I'll see if I can get both PRs pushed through

@drashna
Copy link
Member

drashna commented Apr 7, 2019

Just to clarify, the issue still occurs, with the corrected code.

@drashna
Copy link
Member

drashna commented Apr 11, 2019

Okay, it looks like this may be a hardware issue with one of my boards. I can't reproduce it on another split keyboard, both iris keyboards, actually. Even swapping usb cables and TRRS cables. So ... yay.

But that means that this should be good to go!

@@ -280,6 +280,23 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_1)/config.h)","")
CONFIG_H += $(KEYBOARD_PATH_1)/config.h
endif

POST_CONFIG_H :=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this required to work properly?

Eg, can the post_config stuff be moved so this isn't needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is necessary.
It is necessary to prevent unnecessary dependencies between header files between modules in lower layers.

For example, quantum/split_common/transport.c needs to define SERIAL_USE_MULTI_TRANSACTION of serial when using RGBLIGHT_SPLIT.
It is not good to solve this with serial.h and rgblight.h.

@drashna drashna merged commit 7e67bd7 into qmk:master Apr 19, 2019
@drashna
Copy link
Member

drashna commented Apr 22, 2019

I was wrong.

The issue is when switching to mode 1 (solid color). Any time you change to it, the slave half does NOT switch.

drashna pushed a commit to zsa/qmk_firmware that referenced this pull request Apr 22, 2019
* add I2C_slave_buffer_t to quantum/split_common/transport.c

Improvements to ease the maintenance of the I2C slave buffer layout. And this commit does not change the compilation results.

* add temporary pdhelix(Patched Helix) code

* temporary cherry-pick from qmk#5020

add new version(qmk#5020) quantum/rgblight.[ch], quantum/rgblight_modes.h

* add post_config.h support to build_keyboard.mk

* add quantum/rgblight_post_config.h, quantum/split_common/post_config.h

Add quantum/rgblight_post_config.h and quantum/split_common/post_config.h using POST_CONFIG_H variable of build_keyboard.mk.

quantum/rgblight_post_config.h additionally defines RGBLIGHT_SPLIT if RGBLED_SPIT is defined.

quantum/split_common/post_config.h defines RGBLIGHT_SPLIT additionally when master-slave communication is I2C.

* Change split_common's transport.c I2C to use the synchronization feature of rgblight.c

* Change split_common's transport.c serial to use the synchronization feature of rgblight.c

* test RGBLIGHT_SPLIT on keyboards/handwired/pdhelix

* Test End Revert "test RGBLIGHT_SPLIT on keyboards/handwired/pdhelix"

This reverts commit 80118a6.

[x] make RGBLIGHT_TEST=1 handwired/pdhelix/i2c:default
[x] make RGBLIGHT_TEST=2 handwired/pdhelix/i2c:default (same RGBLIGHT_TEST=3)
[x] make RGBLIGHT_TEST=3 handwired/pdhelix/i2c:default

[x] make RGBLIGHT_TEST=1 handwired/pdhelix/pd2:default
[x] make RGBLIGHT_TEST=2 handwired/pdhelix/pd2:default
[x] make RGBLIGHT_TEST=3 handwired/pdhelix/pd2:default

[x] make RGBLIGHT_TEST=1 handwired/pdhelix/pd2_2oled:default
[x] make RGBLIGHT_TEST=2 handwired/pdhelix/pd2_2oled:default
[x] make RGBLIGHT_TEST=3 handwired/pdhelix/pd2_2oled:default

* Test End, Revert "temporary cherry-pick from qmk#5020"

This reverts commit d35069f.

* Test End, Revert "add temporary pdhelix(Patched Helix) code"

This reverts commit aebddfc.

* temporarily cherry-pick from qmk#5020 to see if it passes the travis-ci test.

add new version(qmk#5020) quantum/rgblight.[ch], quantum/rgblight_modes.h

* Passed the travis-ci test. Revert "temporarily cherry-pick from qmk#5020 to see if it passes the travis-ci test."

This reverts commit 647c0a9.

* update docs/config_options.md

* update split_common/transport.c, improves maintainability of serial transaction IDs.

No change in build result.

* temporary cherry-pick from qmk#5020

* fix build fail keebio/iris/rev3:default

* fix build fail lets_split_eh/eh:default

* Revert "temporary cherry-pick from qmk#5020"

This reverts commit be48ca1.

* temporary cherry-pick from qmk#5020 (0.6.336)

* Revert "temporary cherry-pick from qmk#5020 (0.6.336)"

This reverts commit 978d26a.

* temporary cherry-pick from qmk#5020 (0.6.336)
@mtei
Copy link
Contributor Author

mtei commented Apr 22, 2019

I am sorry. I'm debugging now.

@drashna
Copy link
Member

drashna commented Apr 22, 2019

Well, I saw it earlier, but couldn't reliably reproduce. Unfortunately, now I can, for whatever reason.

And I wanted to make you aware of the issue, so it could get fixed.

Other than this issue, it work perfectly.

@Lenbok
Copy link
Contributor

Lenbok commented Apr 22, 2019

Switching to mode 1 is reliable for me on my redox, (at least when switching via RGB_MOD, both regular and shifted). Are you changing mode programmatically, or via a key that goes straight to the mode, or does it do it for you via RGB_MOD as well?

@drashna
Copy link
Member

drashna commented Apr 22, 2019

@Lenbok I'm using rgblight_mode_noeeprom specifically, and doing so via the layer_state_set_user function.

The base layer is solid, not animated... and triggers this. If I change the base layer to be animated instead of solid, there is no issue.

You can see my code here: https://github.com/qmk/qmk_firmware/blob/master/users/drashna/rgb_stuff.c#L278-L337

@mtei
Copy link
Contributor Author

mtei commented Apr 23, 2019

@drashna I found some bugs in rgblight.c (#5694), but unfortunately I was unable to reproduce the symptoms that were in your report.

I tested it with the following code and got back to mode 1 successfully.

https://github.com/mtei/qmk_firmware/blob/a89b747a8996700c9a87fda37ffe1326d1917af1/keyboards/handwired/pdhelix/keymaps/default/keymap.c#L138-L162

@drashna
Copy link
Member

drashna commented Apr 23, 2019

Even with the patch, I can reproduce the issue still.

And I can reliably reproduce it on 2 out of three Iris boards (the 3rd has backlight enabled, and doesn't cause the issue), and on both my orthodox rev1 and rev3.

It seems to be worse when the layers change rapidly.

@mtei mtei mentioned this pull request Apr 24, 2019
13 tasks
foosinn pushed a commit to foosinn/qmk_firmware that referenced this pull request May 6, 2019
* add I2C_slave_buffer_t to quantum/split_common/transport.c

Improvements to ease the maintenance of the I2C slave buffer layout. And this commit does not change the compilation results.

* add temporary pdhelix(Patched Helix) code

* temporary cherry-pick from qmk#5020

add new version(qmk#5020) quantum/rgblight.[ch], quantum/rgblight_modes.h

* add post_config.h support to build_keyboard.mk

* add quantum/rgblight_post_config.h, quantum/split_common/post_config.h

Add quantum/rgblight_post_config.h and quantum/split_common/post_config.h using POST_CONFIG_H variable of build_keyboard.mk.

quantum/rgblight_post_config.h additionally defines RGBLIGHT_SPLIT if RGBLED_SPIT is defined.

quantum/split_common/post_config.h defines RGBLIGHT_SPLIT additionally when master-slave communication is I2C.

* Change split_common's transport.c I2C to use the synchronization feature of rgblight.c

* Change split_common's transport.c serial to use the synchronization feature of rgblight.c

* test RGBLIGHT_SPLIT on keyboards/handwired/pdhelix

* Test End Revert "test RGBLIGHT_SPLIT on keyboards/handwired/pdhelix"

This reverts commit 80118a6.

[x] make RGBLIGHT_TEST=1 handwired/pdhelix/i2c:default
[x] make RGBLIGHT_TEST=2 handwired/pdhelix/i2c:default (same RGBLIGHT_TEST=3)
[x] make RGBLIGHT_TEST=3 handwired/pdhelix/i2c:default

[x] make RGBLIGHT_TEST=1 handwired/pdhelix/pd2:default
[x] make RGBLIGHT_TEST=2 handwired/pdhelix/pd2:default
[x] make RGBLIGHT_TEST=3 handwired/pdhelix/pd2:default

[x] make RGBLIGHT_TEST=1 handwired/pdhelix/pd2_2oled:default
[x] make RGBLIGHT_TEST=2 handwired/pdhelix/pd2_2oled:default
[x] make RGBLIGHT_TEST=3 handwired/pdhelix/pd2_2oled:default

* Test End, Revert "temporary cherry-pick from qmk#5020"

This reverts commit d35069f.

* Test End, Revert "add temporary pdhelix(Patched Helix) code"

This reverts commit aebddfc.

* temporarily cherry-pick from qmk#5020 to see if it passes the travis-ci test.

add new version(qmk#5020) quantum/rgblight.[ch], quantum/rgblight_modes.h

* Passed the travis-ci test. Revert "temporarily cherry-pick from qmk#5020 to see if it passes the travis-ci test."

This reverts commit 647c0a9.

* update docs/config_options.md

* update split_common/transport.c, improves maintainability of serial transaction IDs.

No change in build result.

* temporary cherry-pick from qmk#5020

* fix build fail keebio/iris/rev3:default

* fix build fail lets_split_eh/eh:default

* Revert "temporary cherry-pick from qmk#5020"

This reverts commit be48ca1.

* temporary cherry-pick from qmk#5020 (0.6.336)

* Revert "temporary cherry-pick from qmk#5020 (0.6.336)"

This reverts commit 978d26a.

* temporary cherry-pick from qmk#5020 (0.6.336)
@mtei mtei deleted the split_common-use-RGBLIGHT_SPLIT branch May 11, 2019 06:43
shimesaba-type0 pushed a commit to shimesaba-type0/qmk_firmware that referenced this pull request Jun 22, 2019
* add I2C_slave_buffer_t to quantum/split_common/transport.c

Improvements to ease the maintenance of the I2C slave buffer layout. And this commit does not change the compilation results.

* add temporary pdhelix(Patched Helix) code

* temporary cherry-pick from qmk#5020

add new version(qmk#5020) quantum/rgblight.[ch], quantum/rgblight_modes.h

* add post_config.h support to build_keyboard.mk

* add quantum/rgblight_post_config.h, quantum/split_common/post_config.h

Add quantum/rgblight_post_config.h and quantum/split_common/post_config.h using POST_CONFIG_H variable of build_keyboard.mk.

quantum/rgblight_post_config.h additionally defines RGBLIGHT_SPLIT if RGBLED_SPIT is defined.

quantum/split_common/post_config.h defines RGBLIGHT_SPLIT additionally when master-slave communication is I2C.

* Change split_common's transport.c I2C to use the synchronization feature of rgblight.c

* Change split_common's transport.c serial to use the synchronization feature of rgblight.c

* test RGBLIGHT_SPLIT on keyboards/handwired/pdhelix

* Test End Revert "test RGBLIGHT_SPLIT on keyboards/handwired/pdhelix"

This reverts commit 80118a6.

[x] make RGBLIGHT_TEST=1 handwired/pdhelix/i2c:default
[x] make RGBLIGHT_TEST=2 handwired/pdhelix/i2c:default (same RGBLIGHT_TEST=3)
[x] make RGBLIGHT_TEST=3 handwired/pdhelix/i2c:default

[x] make RGBLIGHT_TEST=1 handwired/pdhelix/pd2:default
[x] make RGBLIGHT_TEST=2 handwired/pdhelix/pd2:default
[x] make RGBLIGHT_TEST=3 handwired/pdhelix/pd2:default

[x] make RGBLIGHT_TEST=1 handwired/pdhelix/pd2_2oled:default
[x] make RGBLIGHT_TEST=2 handwired/pdhelix/pd2_2oled:default
[x] make RGBLIGHT_TEST=3 handwired/pdhelix/pd2_2oled:default

* Test End, Revert "temporary cherry-pick from qmk#5020"

This reverts commit d35069f.

* Test End, Revert "add temporary pdhelix(Patched Helix) code"

This reverts commit aebddfc.

* temporarily cherry-pick from qmk#5020 to see if it passes the travis-ci test.

add new version(qmk#5020) quantum/rgblight.[ch], quantum/rgblight_modes.h

* Passed the travis-ci test. Revert "temporarily cherry-pick from qmk#5020 to see if it passes the travis-ci test."

This reverts commit 647c0a9.

* update docs/config_options.md

* update split_common/transport.c, improves maintainability of serial transaction IDs.

No change in build result.

* temporary cherry-pick from qmk#5020

* fix build fail keebio/iris/rev3:default

* fix build fail lets_split_eh/eh:default

* Revert "temporary cherry-pick from qmk#5020"

This reverts commit be48ca1.

* temporary cherry-pick from qmk#5020 (0.6.336)

* Revert "temporary cherry-pick from qmk#5020 (0.6.336)"

This reverts commit 978d26a.

* temporary cherry-pick from qmk#5020 (0.6.336)
Timbus pushed a commit to Timbus/qmk_firmware that referenced this pull request Jun 23, 2019
* add I2C_slave_buffer_t to quantum/split_common/transport.c

Improvements to ease the maintenance of the I2C slave buffer layout. And this commit does not change the compilation results.

* add temporary pdhelix(Patched Helix) code

* temporary cherry-pick from qmk#5020

add new version(qmk#5020) quantum/rgblight.[ch], quantum/rgblight_modes.h

* add post_config.h support to build_keyboard.mk

* add quantum/rgblight_post_config.h, quantum/split_common/post_config.h

Add quantum/rgblight_post_config.h and quantum/split_common/post_config.h using POST_CONFIG_H variable of build_keyboard.mk.

quantum/rgblight_post_config.h additionally defines RGBLIGHT_SPLIT if RGBLED_SPIT is defined.

quantum/split_common/post_config.h defines RGBLIGHT_SPLIT additionally when master-slave communication is I2C.

* Change split_common's transport.c I2C to use the synchronization feature of rgblight.c

* Change split_common's transport.c serial to use the synchronization feature of rgblight.c

* test RGBLIGHT_SPLIT on keyboards/handwired/pdhelix

* Test End Revert "test RGBLIGHT_SPLIT on keyboards/handwired/pdhelix"

This reverts commit 80118a6.

[x] make RGBLIGHT_TEST=1 handwired/pdhelix/i2c:default
[x] make RGBLIGHT_TEST=2 handwired/pdhelix/i2c:default (same RGBLIGHT_TEST=3)
[x] make RGBLIGHT_TEST=3 handwired/pdhelix/i2c:default

[x] make RGBLIGHT_TEST=1 handwired/pdhelix/pd2:default
[x] make RGBLIGHT_TEST=2 handwired/pdhelix/pd2:default
[x] make RGBLIGHT_TEST=3 handwired/pdhelix/pd2:default

[x] make RGBLIGHT_TEST=1 handwired/pdhelix/pd2_2oled:default
[x] make RGBLIGHT_TEST=2 handwired/pdhelix/pd2_2oled:default
[x] make RGBLIGHT_TEST=3 handwired/pdhelix/pd2_2oled:default

* Test End, Revert "temporary cherry-pick from qmk#5020"

This reverts commit d35069f.

* Test End, Revert "add temporary pdhelix(Patched Helix) code"

This reverts commit aebddfc.

* temporarily cherry-pick from qmk#5020 to see if it passes the travis-ci test.

add new version(qmk#5020) quantum/rgblight.[ch], quantum/rgblight_modes.h

* Passed the travis-ci test. Revert "temporarily cherry-pick from qmk#5020 to see if it passes the travis-ci test."

This reverts commit 647c0a9.

* update docs/config_options.md

* update split_common/transport.c, improves maintainability of serial transaction IDs.

No change in build result.

* temporary cherry-pick from qmk#5020

* fix build fail keebio/iris/rev3:default

* fix build fail lets_split_eh/eh:default

* Revert "temporary cherry-pick from qmk#5020"

This reverts commit be48ca1.

* temporary cherry-pick from qmk#5020 (0.6.336)

* Revert "temporary cherry-pick from qmk#5020 (0.6.336)"

This reverts commit 978d26a.

* temporary cherry-pick from qmk#5020 (0.6.336)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants