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

Add function to support split-keyboard in rgblight.[ch]. #5020

Merged
merged 59 commits into from
Apr 19, 2019

Conversation

mtei
Copy link
Contributor

@mtei mtei commented Jan 31, 2019

Description

The purpose of this PR is to add to quantum/rgblight.[ch] a function to synchronize RGB information provided to the transport layer for split keyboards. (Changes in transport layer of split keyboard are outside the scope of this PR.)

The synchronization feature is enabled in config.h by declaring #define RGBLIGHT_SPLIT.

The following functions are enabled by declaring #define RGBLIGHT_SPLIT.

#ifdef RGBLIGHT_SPLIT
  #define RGBLIGHT_STATUS_CHANGE_MODE (1<<0)
  #define RGBLIGHT_STATUS_CHANGE_HSVS (1<<1)
  #define RGBLIGHT_STATUS_CHANGE_TIMER (1<<2)
  #define RGBLIGHT_STATUS_ANIMATION_TICK (1<<3)

  typedef struct _rgblight_syncinfo_t {
    rgblight_config_t config;
    rgblight_status_t status;
  } rgblight_syncinfo_t;

  /* for split keyboard master side */
  uint8_t rgblight_get_change_flags(void);
  void rgblight_clear_change_flags(void);
  void rgblight_get_syncinfo(rgblight_syncinfo_t *syncinfo);
  /* for split keyboard slave side */
  void rgblight_update_sync(rgblight_syncinfo_t *syncinfo, bool write_to_eeprom);
#endif

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. (https://docs.qmk.fm/#/contributing)
  • 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).

@Lenbok
Copy link
Contributor

Lenbok commented Jan 31, 2019

Is the purpose of this PR to enable synchronization/transmission of global timestamp between split halves to synchronize animations?

BTW, If you are not already aware of it, you may want to look at #4974 which removes the BACKLIT_DIRTY/RGB_DIRTY flags in favour of detecting value changes implicitly. (edit: I see you commented earlier on that PR, so are aware of it)

@mtei
Copy link
Contributor Author

mtei commented Feb 1, 2019

Is the purpose of this PR to enable synchronization/transmission of global timestamp between split halves to synchronize animations?

One of the aims of this PR is to enable the transmission of some synchronization information between the divided half to synchronize the animation.

BTW, If you are not already aware of it, you may want to look at #4974 which removes the BACKLIT_DIRTY/RGB_DIRTY flags ....

Yes, I know the #4974. This PR needs to have #4974 merged first, to delete global variable RGB_DIRTY.

@Lenbok
Copy link
Contributor

Lenbok commented Feb 2, 2019

I would love to see the i2c animations working nicely. I mentioned in #773 (comment) that the way that animation step times are currently computed means that any execution delays will offset the animation, leading to loss of visual synchronization. This fits in with my recent observations that the master side does tend to execute animations slower than the slave side. I just gave the delay-independent scheduling idea a quick test with:

Lenbok@092fa43

and with that change, the animations between the two halves stay synchronized very well (although having absolute step times means the animation tries to catch up when time is spent away from the animation e.g. on some other mode or with it switched off, so some reset/restart method is needed)

Explicit synchronization between halves of the kind you are working towards here would be only be needed under special circumstances, e.g. to init the animation to the starting frame when the mode changes.

@mtei
Copy link
Contributor Author

mtei commented Feb 2, 2019

I intended to make the same changes you made below.

-   last_timer = timer_read();
+   last_timer += interval_timer;

mtei added a commit to mtei/qmk_firmware that referenced this pull request Apr 16, 2019
mtei added a commit to mtei/qmk_firmware that referenced this pull request Apr 16, 2019
@Lenbok
Copy link
Contributor

Lenbok commented Apr 18, 2019

Quick @drashna, merge before another conflict creeps in!

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

drashna commented Apr 19, 2019

Merged!
Waiting on Travis for 5509. But counting the seconds :D

drashna pushed a commit that referenced this pull request Apr 19, 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 #5020

add new version(#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 #5020"

This reverts commit d35069f.

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

This reverts commit aebddfc.

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

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

* Passed the travis-ci test. Revert "temporarily cherry-pick from #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 #5020

* fix build fail keebio/iris/rev3:default

* fix build fail lets_split_eh/eh:default

* Revert "temporary cherry-pick from #5020"

This reverts commit be48ca1.

* temporary cherry-pick from #5020 (0.6.336)

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

This reverts commit 978d26a.

* temporary cherry-pick from #5020 (0.6.336)
@mtei mtei deleted the rgblight.c-add-split-hook branch April 20, 2019 08:37
drashna pushed a commit to zsa/qmk_firmware that referenced this pull request Apr 22, 2019
* add temporary file that is rgblight.c call graph

* add rgblight_update_hook()

* update rgblight-call-graph.dot (temporary file)

* add more hook point

* add TODO comment

* temporary Revert "add TODO comment"

This reverts commit df6165a.

* temporary Revert "add more hook point"

This reverts commit 64592b0.

* temporary Revert "add rgblight_update_hook()"

This reverts commit 432b74c.

* add rgblight_update_hook()

* add more hook point

* add TODO comment

* implement rgblight_update_hook()

* remove rgblight_update_hook(), add RGBLIGHT_SPLIT_SET_CHANGE_XXXX

rgblight_update_hook() is too large.
change to simple flag setting.

* shrink rgblight_config_t

* implement rgblight_update_sync()

Note: The animation synchronization process has not been implemented yet.

* update quantum/rgblight-call-graph.dot (temporary file)

* rmove quantum/rgblight-call-graph.dot (temporary file)

* update rgblight.c

* Add temporary code to Helix keyboard 'five_rows' keymap to test rgblight.c .

* fix build break rgblight_update_sync() when all animation off

* fix quantum/rgblight.c:rgblight_disable_XX() add RGBLIGHT_SPLIT_SET_CHANGE_MODE

* quantum/rgblight.c change code order: move rgblight_update_sync()

* add mode_base_table[] to quantum/rgblight.c

* quantum/rgblight.c use mode_base_table[] and rgblight_status.base_mode

* quantum/rgblkght.c animation timer integration

* quantum/rgblkght.c add animation sync for split keyboard

* fix mode_base_table[] and snake effect

* fix build break keyboards/mxss.

keyboards/mxss's local rgblight.c need old version rgblight.h

* rgblight.c: fix animation sync

* quantum/rgblight.c: fix snake effect sync

* quantum/rgblight.c: animation sync interverl 30 sec

* quantum/rgblight.c: fix rgblight_effect_rainbow_swirl() and rgblight_effect_knight()

* quantum/rgblight.c: add macro RGBLIGHT_SPLIT_ANIMATION

* cherry-pick from 'rgblight_modes.h sample implementation'

* fix RGBLIGHT_SPLIT_ANIMATION check position

* Update temporary code in Helix keyboard 'five_rows' keymap to test rgblight.c

* Reduce the firmware size by 1500 bytes when rgblight_effect_breathing() is enabled.

* Changed to rgblight_sethsv_eeprom_helper() for easier reading.

* add fail-safe code to quantum/rgblight.c:rgblight_task(),rgblight_timer_enable()

* remove temporary code in Helix keyboard 'five_rows' keymap

* quantum/rgblight.c: add split-keyboard master side sync functions

add functions:
  uint8_t rgblight_get_change_flags(void);
  void rgblight_clear_change_flags(void);
  void rgblight_get_syncinfo(rgblight_syncinfo_t *syncinfo);

change function:
  void rgblight_update_sync(rgblight_syncinfo_t *syncinfo, bool write_to_eeprom);

* Change rgblight_update_sync() to use write_to_eeprom.

* remove TODO comment from quantum/rgblight.h

* Revert "fix build break keyboards/mxss."

This reverts commit 90b9a1a.
(Separated this change into the newly opened PR qmk#5461.)

* Revert "Reduce the firmware size by 1500 bytes when rgblight_effect_breathing() is enabled."

This reverts commit b61004e.

* update quantum/rgblight.c: Code size reduction when not using RGBLIGHT_SPLIT.

* Add temporary code to Helix keyboard 'five_rows' keymap to test rgblight.c .

* add temporary pdhelix(Patched Helix) code

* Add temporary code to split_common/transport.c to test rgblight.c.

* Finish testing rgblight.c with helix keyboard.

Revert "Add temporary code to Helix keyboard 'five_rows' keymap to test rgblight.c ."

This reverts commit 0bf81a4.

* Finish testing rgblight.c with quantum/split_common code.

Revert "Add temporary code to split_common/transport.c to test rgblight.c."

This reverts commit 71db3e2.

* remove temporary pdhelix(Patched Helix) code

This reverts commit 5287e51.

* Added description of RGBLIGHT_SPLIT macro to docs/feature_rgblight.md.

* add RGBLIGHT_SPLIT_SET_CHANGE_HSVS to rgblight_init()

* Changed to restart animation only when changing mode.

When changing hue, sat and val, the animation is not restarted and continues.
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)
foosinn pushed a commit to foosinn/qmk_firmware that referenced this pull request May 6, 2019
* add temporary file that is rgblight.c call graph

* add rgblight_update_hook()

* update rgblight-call-graph.dot (temporary file)

* add more hook point

* add TODO comment

* temporary Revert "add TODO comment"

This reverts commit df6165a.

* temporary Revert "add more hook point"

This reverts commit 64592b0.

* temporary Revert "add rgblight_update_hook()"

This reverts commit 432b74c.

* add rgblight_update_hook()

* add more hook point

* add TODO comment

* implement rgblight_update_hook()

* remove rgblight_update_hook(), add RGBLIGHT_SPLIT_SET_CHANGE_XXXX

rgblight_update_hook() is too large.
change to simple flag setting.

* shrink rgblight_config_t

* implement rgblight_update_sync()

Note: The animation synchronization process has not been implemented yet.

* update quantum/rgblight-call-graph.dot (temporary file)

* rmove quantum/rgblight-call-graph.dot (temporary file)

* update rgblight.c

* Add temporary code to Helix keyboard 'five_rows' keymap to test rgblight.c .

* fix build break rgblight_update_sync() when all animation off

* fix quantum/rgblight.c:rgblight_disable_XX() add RGBLIGHT_SPLIT_SET_CHANGE_MODE

* quantum/rgblight.c change code order: move rgblight_update_sync()

* add mode_base_table[] to quantum/rgblight.c

* quantum/rgblight.c use mode_base_table[] and rgblight_status.base_mode

* quantum/rgblkght.c animation timer integration

* quantum/rgblkght.c add animation sync for split keyboard

* fix mode_base_table[] and snake effect

* fix build break keyboards/mxss.

keyboards/mxss's local rgblight.c need old version rgblight.h

* rgblight.c: fix animation sync

* quantum/rgblight.c: fix snake effect sync

* quantum/rgblight.c: animation sync interverl 30 sec

* quantum/rgblight.c: fix rgblight_effect_rainbow_swirl() and rgblight_effect_knight()

* quantum/rgblight.c: add macro RGBLIGHT_SPLIT_ANIMATION

* cherry-pick from 'rgblight_modes.h sample implementation'

* fix RGBLIGHT_SPLIT_ANIMATION check position

* Update temporary code in Helix keyboard 'five_rows' keymap to test rgblight.c

* Reduce the firmware size by 1500 bytes when rgblight_effect_breathing() is enabled.

* Changed to rgblight_sethsv_eeprom_helper() for easier reading.

* add fail-safe code to quantum/rgblight.c:rgblight_task(),rgblight_timer_enable()

* remove temporary code in Helix keyboard 'five_rows' keymap

* quantum/rgblight.c: add split-keyboard master side sync functions

add functions:
  uint8_t rgblight_get_change_flags(void);
  void rgblight_clear_change_flags(void);
  void rgblight_get_syncinfo(rgblight_syncinfo_t *syncinfo);

change function:
  void rgblight_update_sync(rgblight_syncinfo_t *syncinfo, bool write_to_eeprom);

* Change rgblight_update_sync() to use write_to_eeprom.

* remove TODO comment from quantum/rgblight.h

* Revert "fix build break keyboards/mxss."

This reverts commit 90b9a1a.
(Separated this change into the newly opened PR qmk#5461.)

* Revert "Reduce the firmware size by 1500 bytes when rgblight_effect_breathing() is enabled."

This reverts commit b61004e.

* update quantum/rgblight.c: Code size reduction when not using RGBLIGHT_SPLIT.

* Add temporary code to Helix keyboard 'five_rows' keymap to test rgblight.c .

* add temporary pdhelix(Patched Helix) code

* Add temporary code to split_common/transport.c to test rgblight.c.

* Finish testing rgblight.c with helix keyboard.

Revert "Add temporary code to Helix keyboard 'five_rows' keymap to test rgblight.c ."

This reverts commit 0bf81a4.

* Finish testing rgblight.c with quantum/split_common code.

Revert "Add temporary code to split_common/transport.c to test rgblight.c."

This reverts commit 71db3e2.

* remove temporary pdhelix(Patched Helix) code

This reverts commit 5287e51.

* Added description of RGBLIGHT_SPLIT macro to docs/feature_rgblight.md.

* add RGBLIGHT_SPLIT_SET_CHANGE_HSVS to rgblight_init()

* Changed to restart animation only when changing mode.

When changing hue, sat and val, the animation is not restarted and continues.
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)
danielo515 pushed a commit to danielo515/qmk_firmware that referenced this pull request May 15, 2019
This PR is cherry-pick from 90b9a1a in PR qmk#5020.

@MxBlu copied quantum/rgblight.c to keyboards/mxss/rgblight.c on July 8, 2018. At that time, I think it would be better to copy quantum/rgblight.h at the same time.
Because if someone makes a change to `quantum/rgblight.[ch]` that is incompatible with the past, it may cause problems with the compilation of keyboards/mxss.
(Like when I changed the prototype of the `rgblight_effect_XXX()` functions of rgblight.c in PR qmk#5020.)
shimesaba-type0 pushed a commit to shimesaba-type0/qmk_firmware that referenced this pull request Jun 22, 2019
* add temporary file that is rgblight.c call graph

* add rgblight_update_hook()

* update rgblight-call-graph.dot (temporary file)

* add more hook point

* add TODO comment

* temporary Revert "add TODO comment"

This reverts commit df6165a.

* temporary Revert "add more hook point"

This reverts commit 64592b0.

* temporary Revert "add rgblight_update_hook()"

This reverts commit 432b74c.

* add rgblight_update_hook()

* add more hook point

* add TODO comment

* implement rgblight_update_hook()

* remove rgblight_update_hook(), add RGBLIGHT_SPLIT_SET_CHANGE_XXXX

rgblight_update_hook() is too large.
change to simple flag setting.

* shrink rgblight_config_t

* implement rgblight_update_sync()

Note: The animation synchronization process has not been implemented yet.

* update quantum/rgblight-call-graph.dot (temporary file)

* rmove quantum/rgblight-call-graph.dot (temporary file)

* update rgblight.c

* Add temporary code to Helix keyboard 'five_rows' keymap to test rgblight.c .

* fix build break rgblight_update_sync() when all animation off

* fix quantum/rgblight.c:rgblight_disable_XX() add RGBLIGHT_SPLIT_SET_CHANGE_MODE

* quantum/rgblight.c change code order: move rgblight_update_sync()

* add mode_base_table[] to quantum/rgblight.c

* quantum/rgblight.c use mode_base_table[] and rgblight_status.base_mode

* quantum/rgblkght.c animation timer integration

* quantum/rgblkght.c add animation sync for split keyboard

* fix mode_base_table[] and snake effect

* fix build break keyboards/mxss.

keyboards/mxss's local rgblight.c need old version rgblight.h

* rgblight.c: fix animation sync

* quantum/rgblight.c: fix snake effect sync

* quantum/rgblight.c: animation sync interverl 30 sec

* quantum/rgblight.c: fix rgblight_effect_rainbow_swirl() and rgblight_effect_knight()

* quantum/rgblight.c: add macro RGBLIGHT_SPLIT_ANIMATION

* cherry-pick from 'rgblight_modes.h sample implementation'

* fix RGBLIGHT_SPLIT_ANIMATION check position

* Update temporary code in Helix keyboard 'five_rows' keymap to test rgblight.c

* Reduce the firmware size by 1500 bytes when rgblight_effect_breathing() is enabled.

* Changed to rgblight_sethsv_eeprom_helper() for easier reading.

* add fail-safe code to quantum/rgblight.c:rgblight_task(),rgblight_timer_enable()

* remove temporary code in Helix keyboard 'five_rows' keymap

* quantum/rgblight.c: add split-keyboard master side sync functions

add functions:
  uint8_t rgblight_get_change_flags(void);
  void rgblight_clear_change_flags(void);
  void rgblight_get_syncinfo(rgblight_syncinfo_t *syncinfo);

change function:
  void rgblight_update_sync(rgblight_syncinfo_t *syncinfo, bool write_to_eeprom);

* Change rgblight_update_sync() to use write_to_eeprom.

* remove TODO comment from quantum/rgblight.h

* Revert "fix build break keyboards/mxss."

This reverts commit 90b9a1a.
(Separated this change into the newly opened PR qmk#5461.)

* Revert "Reduce the firmware size by 1500 bytes when rgblight_effect_breathing() is enabled."

This reverts commit b61004e.

* update quantum/rgblight.c: Code size reduction when not using RGBLIGHT_SPLIT.

* Add temporary code to Helix keyboard 'five_rows' keymap to test rgblight.c .

* add temporary pdhelix(Patched Helix) code

* Add temporary code to split_common/transport.c to test rgblight.c.

* Finish testing rgblight.c with helix keyboard.

Revert "Add temporary code to Helix keyboard 'five_rows' keymap to test rgblight.c ."

This reverts commit 0bf81a4.

* Finish testing rgblight.c with quantum/split_common code.

Revert "Add temporary code to split_common/transport.c to test rgblight.c."

This reverts commit 71db3e2.

* remove temporary pdhelix(Patched Helix) code

This reverts commit 5287e51.

* Added description of RGBLIGHT_SPLIT macro to docs/feature_rgblight.md.

* add RGBLIGHT_SPLIT_SET_CHANGE_HSVS to rgblight_init()

* Changed to restart animation only when changing mode.

When changing hue, sat and val, the animation is not restarted and continues.
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
This PR is cherry-pick from 90b9a1a in PR qmk#5020.

@MxBlu copied quantum/rgblight.c to keyboards/mxss/rgblight.c on July 8, 2018. At that time, I think it would be better to copy quantum/rgblight.h at the same time.
Because if someone makes a change to `quantum/rgblight.[ch]` that is incompatible with the past, it may cause problems with the compilation of keyboards/mxss.
(Like when I changed the prototype of the `rgblight_effect_XXX()` functions of rgblight.c in PR qmk#5020.)
Timbus pushed a commit to Timbus/qmk_firmware that referenced this pull request Jun 23, 2019
* add temporary file that is rgblight.c call graph

* add rgblight_update_hook()

* update rgblight-call-graph.dot (temporary file)

* add more hook point

* add TODO comment

* temporary Revert "add TODO comment"

This reverts commit df6165a.

* temporary Revert "add more hook point"

This reverts commit 64592b0.

* temporary Revert "add rgblight_update_hook()"

This reverts commit 432b74c.

* add rgblight_update_hook()

* add more hook point

* add TODO comment

* implement rgblight_update_hook()

* remove rgblight_update_hook(), add RGBLIGHT_SPLIT_SET_CHANGE_XXXX

rgblight_update_hook() is too large.
change to simple flag setting.

* shrink rgblight_config_t

* implement rgblight_update_sync()

Note: The animation synchronization process has not been implemented yet.

* update quantum/rgblight-call-graph.dot (temporary file)

* rmove quantum/rgblight-call-graph.dot (temporary file)

* update rgblight.c

* Add temporary code to Helix keyboard 'five_rows' keymap to test rgblight.c .

* fix build break rgblight_update_sync() when all animation off

* fix quantum/rgblight.c:rgblight_disable_XX() add RGBLIGHT_SPLIT_SET_CHANGE_MODE

* quantum/rgblight.c change code order: move rgblight_update_sync()

* add mode_base_table[] to quantum/rgblight.c

* quantum/rgblight.c use mode_base_table[] and rgblight_status.base_mode

* quantum/rgblkght.c animation timer integration

* quantum/rgblkght.c add animation sync for split keyboard

* fix mode_base_table[] and snake effect

* fix build break keyboards/mxss.

keyboards/mxss's local rgblight.c need old version rgblight.h

* rgblight.c: fix animation sync

* quantum/rgblight.c: fix snake effect sync

* quantum/rgblight.c: animation sync interverl 30 sec

* quantum/rgblight.c: fix rgblight_effect_rainbow_swirl() and rgblight_effect_knight()

* quantum/rgblight.c: add macro RGBLIGHT_SPLIT_ANIMATION

* cherry-pick from 'rgblight_modes.h sample implementation'

* fix RGBLIGHT_SPLIT_ANIMATION check position

* Update temporary code in Helix keyboard 'five_rows' keymap to test rgblight.c

* Reduce the firmware size by 1500 bytes when rgblight_effect_breathing() is enabled.

* Changed to rgblight_sethsv_eeprom_helper() for easier reading.

* add fail-safe code to quantum/rgblight.c:rgblight_task(),rgblight_timer_enable()

* remove temporary code in Helix keyboard 'five_rows' keymap

* quantum/rgblight.c: add split-keyboard master side sync functions

add functions:
  uint8_t rgblight_get_change_flags(void);
  void rgblight_clear_change_flags(void);
  void rgblight_get_syncinfo(rgblight_syncinfo_t *syncinfo);

change function:
  void rgblight_update_sync(rgblight_syncinfo_t *syncinfo, bool write_to_eeprom);

* Change rgblight_update_sync() to use write_to_eeprom.

* remove TODO comment from quantum/rgblight.h

* Revert "fix build break keyboards/mxss."

This reverts commit 90b9a1a.
(Separated this change into the newly opened PR qmk#5461.)

* Revert "Reduce the firmware size by 1500 bytes when rgblight_effect_breathing() is enabled."

This reverts commit b61004e.

* update quantum/rgblight.c: Code size reduction when not using RGBLIGHT_SPLIT.

* Add temporary code to Helix keyboard 'five_rows' keymap to test rgblight.c .

* add temporary pdhelix(Patched Helix) code

* Add temporary code to split_common/transport.c to test rgblight.c.

* Finish testing rgblight.c with helix keyboard.

Revert "Add temporary code to Helix keyboard 'five_rows' keymap to test rgblight.c ."

This reverts commit 0bf81a4.

* Finish testing rgblight.c with quantum/split_common code.

Revert "Add temporary code to split_common/transport.c to test rgblight.c."

This reverts commit 71db3e2.

* remove temporary pdhelix(Patched Helix) code

This reverts commit 5287e51.

* Added description of RGBLIGHT_SPLIT macro to docs/feature_rgblight.md.

* add RGBLIGHT_SPLIT_SET_CHANGE_HSVS to rgblight_init()

* Changed to restart animation only when changing mode.

When changing hue, sat and val, the animation is not restarted and continues.
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)
zer09 pushed a commit to zer09/qmk_firmware that referenced this pull request Nov 26, 2019
This PR is cherry-pick from 90b9a1a in PR qmk#5020.

@MxBlu copied quantum/rgblight.c to keyboards/mxss/rgblight.c on July 8, 2018. At that time, I think it would be better to copy quantum/rgblight.h at the same time.
Because if someone makes a change to `quantum/rgblight.[ch]` that is incompatible with the past, it may cause problems with the compilation of keyboards/mxss.
(Like when I changed the prototype of the `rgblight_effect_XXX()` functions of rgblight.c in PR qmk#5020.)
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.

None yet

4 participants