You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

314 lines
11 KiB

Add function to support split-keyboard in rgblight.[ch]. (#5020) * 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 df6165aac9b3a31d1d3e31ce52aadc134b84eac2. * temporary Revert "add more hook point" This reverts commit 64592b06f3bcdaac47c59f922018a273bef76776. * temporary Revert "add rgblight_update_hook()" This reverts commit 432b74c912ed4333e6633e20a1bcda10c6a10eaf. * 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 90b9a1aa7d8af226751500e49e3ea0214cc4e024. (Separated this change into the newly opened PR #5461.) * Revert "Reduce the firmware size by 1500 bytes when rgblight_effect_breathing() is enabled." This reverts commit b61004e63e82cf5334cee4def4ba10cffa88885f. * 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 0bf81a4723a977adc0cb09b4272ee5c9b4f2bbbb. * 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 71db3e24eef40d4c455fb9fd1664e4487c9d927a. * remove temporary pdhelix(Patched Helix) code This reverts commit 5287e51a394741bcb6028c7cfc0dd0c984645f76. * 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.
5 years ago
7 years ago
Lets split eh (#3120) * Line ending stuff again * Added Let's Split Eh? Files and updated #USE_IC2 checks to also include th EH revision (can only be used in I2C) * Added personal keymap, updated some of the EH files * Created new keyboard file for testing "lets_split_eh" will merge into lets_split once fully functional * Added split code from lets_split, removed pro micro imports and LED code THIS IS WORKING CODE, WITHOUT RGB AND BACKLIGHT * Took back original Lets Slit files for the lets_split keyboard, working in the lets_split_eh folder for now * Updated eh.c * More rework of the I2C code, added global flags for split boards. * Introduced RGB over I2C, having weird edge case issues at the moment though * Fixed weird I2C edgecase with RGB, although still would like to track down route cause.. * Changed RGB keycodes (static ones) to activate on key-up instead of key-down to elimate weird ghosting issue over I2C * Lots of changes, mainly externalized the Split keyboard code and added logic for only including when needed. - Added makefile option "SPLIT_KEYBOARD" that when = yes will include the split keyboard files and custom matrix - Split keyboard files placed into quantum/split_common/ - Added define option for config files "SPLIT_HAND_PIN" FOr using high/low pin to determine handedness, low = right hand, high = left hand - Cleaned up split logic for RGB and Backlight so it is only exectuted / included when needed * Updated documentation for the new makefile options and #defines specific to split keyboards * Added a bit more info to docs, so people aren't confused * Modifed Let's Split to use externalized code, also added left and right hand eeprom files to the split_common folder * Removed some debugging from eh.c * Small changes to keyboard configs. Also added a default keymap (just a copy of my that_canadian keymap). * Added a README file to the Let's Split Eh? * Changed it so RGB static updates are done on key-up ONLY for split boards rather than all boards. Also fixed leftover un-used variable in rgblight.c * Updated default keymap and my keymap for Let's Split Eh? Updated the comments so it reflects RGB control, and removed audio functions. * Fixed lets_split_eh not having a default version * Removed "eh" references from lets_split folder for now * Took lets_split folder from master to fix travis build errors, weird my local was overriding. * Changed LAYOUT_ortho_4x12_kc -> LAYOUT_kc_ortho_4x12 to match bakingpy and others * Removed rules.mk from my lets_split keymap, not needed * Updated the config_options doc to better explain the usage of "#define SPLIT_HAND_PIN"
5 years ago
Add function to support split-keyboard in rgblight.[ch]. (#5020) * 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 df6165aac9b3a31d1d3e31ce52aadc134b84eac2. * temporary Revert "add more hook point" This reverts commit 64592b06f3bcdaac47c59f922018a273bef76776. * temporary Revert "add rgblight_update_hook()" This reverts commit 432b74c912ed4333e6633e20a1bcda10c6a10eaf. * 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 90b9a1aa7d8af226751500e49e3ea0214cc4e024. (Separated this change into the newly opened PR #5461.) * Revert "Reduce the firmware size by 1500 bytes when rgblight_effect_breathing() is enabled." This reverts commit b61004e63e82cf5334cee4def4ba10cffa88885f. * 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 0bf81a4723a977adc0cb09b4272ee5c9b4f2bbbb. * 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 71db3e24eef40d4c455fb9fd1664e4487c9d927a. * remove temporary pdhelix(Patched Helix) code This reverts commit 5287e51a394741bcb6028c7cfc0dd0c984645f76. * 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.
5 years ago
Add function to support split-keyboard in rgblight.[ch]. (#5020) * 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 df6165aac9b3a31d1d3e31ce52aadc134b84eac2. * temporary Revert "add more hook point" This reverts commit 64592b06f3bcdaac47c59f922018a273bef76776. * temporary Revert "add rgblight_update_hook()" This reverts commit 432b74c912ed4333e6633e20a1bcda10c6a10eaf. * 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 90b9a1aa7d8af226751500e49e3ea0214cc4e024. (Separated this change into the newly opened PR #5461.) * Revert "Reduce the firmware size by 1500 bytes when rgblight_effect_breathing() is enabled." This reverts commit b61004e63e82cf5334cee4def4ba10cffa88885f. * 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 0bf81a4723a977adc0cb09b4272ee5c9b4f2bbbb. * 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 71db3e24eef40d4c455fb9fd1664e4487c9d927a. * remove temporary pdhelix(Patched Helix) code This reverts commit 5287e51a394741bcb6028c7cfc0dd0c984645f76. * 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.
5 years ago
Add function to support split-keyboard in rgblight.[ch]. (#5020) * 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 df6165aac9b3a31d1d3e31ce52aadc134b84eac2. * temporary Revert "add more hook point" This reverts commit 64592b06f3bcdaac47c59f922018a273bef76776. * temporary Revert "add rgblight_update_hook()" This reverts commit 432b74c912ed4333e6633e20a1bcda10c6a10eaf. * 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 90b9a1aa7d8af226751500e49e3ea0214cc4e024. (Separated this change into the newly opened PR #5461.) * Revert "Reduce the firmware size by 1500 bytes when rgblight_effect_breathing() is enabled." This reverts commit b61004e63e82cf5334cee4def4ba10cffa88885f. * 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 0bf81a4723a977adc0cb09b4272ee5c9b4f2bbbb. * 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 71db3e24eef40d4c455fb9fd1664e4487c9d927a. * remove temporary pdhelix(Patched Helix) code This reverts commit 5287e51a394741bcb6028c7cfc0dd0c984645f76. * 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.
5 years ago
Add function to support split-keyboard in rgblight.[ch]. (#5020) * 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 df6165aac9b3a31d1d3e31ce52aadc134b84eac2. * temporary Revert "add more hook point" This reverts commit 64592b06f3bcdaac47c59f922018a273bef76776. * temporary Revert "add rgblight_update_hook()" This reverts commit 432b74c912ed4333e6633e20a1bcda10c6a10eaf. * 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 90b9a1aa7d8af226751500e49e3ea0214cc4e024. (Separated this change into the newly opened PR #5461.) * Revert "Reduce the firmware size by 1500 bytes when rgblight_effect_breathing() is enabled." This reverts commit b61004e63e82cf5334cee4def4ba10cffa88885f. * 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 0bf81a4723a977adc0cb09b4272ee5c9b4f2bbbb. * 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 71db3e24eef40d4c455fb9fd1664e4487c9d927a. * remove temporary pdhelix(Patched Helix) code This reverts commit 5287e51a394741bcb6028c7cfc0dd0c984645f76. * 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.
5 years ago
Add function to support split-keyboard in rgblight.[ch]. (#5020) * 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 df6165aac9b3a31d1d3e31ce52aadc134b84eac2. * temporary Revert "add more hook point" This reverts commit 64592b06f3bcdaac47c59f922018a273bef76776. * temporary Revert "add rgblight_update_hook()" This reverts commit 432b74c912ed4333e6633e20a1bcda10c6a10eaf. * 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 90b9a1aa7d8af226751500e49e3ea0214cc4e024. (Separated this change into the newly opened PR #5461.) * Revert "Reduce the firmware size by 1500 bytes when rgblight_effect_breathing() is enabled." This reverts commit b61004e63e82cf5334cee4def4ba10cffa88885f. * 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 0bf81a4723a977adc0cb09b4272ee5c9b4f2bbbb. * 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 71db3e24eef40d4c455fb9fd1664e4487c9d927a. * remove temporary pdhelix(Patched Helix) code This reverts commit 5287e51a394741bcb6028c7cfc0dd0c984645f76. * 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.
5 years ago
Add function to support split-keyboard in rgblight.[ch]. (#5020) * 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 df6165aac9b3a31d1d3e31ce52aadc134b84eac2. * temporary Revert "add more hook point" This reverts commit 64592b06f3bcdaac47c59f922018a273bef76776. * temporary Revert "add rgblight_update_hook()" This reverts commit 432b74c912ed4333e6633e20a1bcda10c6a10eaf. * 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 90b9a1aa7d8af226751500e49e3ea0214cc4e024. (Separated this change into the newly opened PR #5461.) * Revert "Reduce the firmware size by 1500 bytes when rgblight_effect_breathing() is enabled." This reverts commit b61004e63e82cf5334cee4def4ba10cffa88885f. * 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 0bf81a4723a977adc0cb09b4272ee5c9b4f2bbbb. * 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 71db3e24eef40d4c455fb9fd1664e4487c9d927a. * remove temporary pdhelix(Patched Helix) code This reverts commit 5287e51a394741bcb6028c7cfc0dd0c984645f76. * 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.
5 years ago
7 years ago
Add function to support split-keyboard in rgblight.[ch]. (#5020) * 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 df6165aac9b3a31d1d3e31ce52aadc134b84eac2. * temporary Revert "add more hook point" This reverts commit 64592b06f3bcdaac47c59f922018a273bef76776. * temporary Revert "add rgblight_update_hook()" This reverts commit 432b74c912ed4333e6633e20a1bcda10c6a10eaf. * 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 90b9a1aa7d8af226751500e49e3ea0214cc4e024. (Separated this change into the newly opened PR #5461.) * Revert "Reduce the firmware size by 1500 bytes when rgblight_effect_breathing() is enabled." This reverts commit b61004e63e82cf5334cee4def4ba10cffa88885f. * 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 0bf81a4723a977adc0cb09b4272ee5c9b4f2bbbb. * 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 71db3e24eef40d4c455fb9fd1664e4487c9d927a. * remove temporary pdhelix(Patched Helix) code This reverts commit 5287e51a394741bcb6028c7cfc0dd0c984645f76. * 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.
5 years ago
Add function to support split-keyboard in rgblight.[ch]. (#5020) * 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 df6165aac9b3a31d1d3e31ce52aadc134b84eac2. * temporary Revert "add more hook point" This reverts commit 64592b06f3bcdaac47c59f922018a273bef76776. * temporary Revert "add rgblight_update_hook()" This reverts commit 432b74c912ed4333e6633e20a1bcda10c6a10eaf. * 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 90b9a1aa7d8af226751500e49e3ea0214cc4e024. (Separated this change into the newly opened PR #5461.) * Revert "Reduce the firmware size by 1500 bytes when rgblight_effect_breathing() is enabled." This reverts commit b61004e63e82cf5334cee4def4ba10cffa88885f. * 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 0bf81a4723a977adc0cb09b4272ee5c9b4f2bbbb. * 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 71db3e24eef40d4c455fb9fd1664e4487c9d927a. * remove temporary pdhelix(Patched Helix) code This reverts commit 5287e51a394741bcb6028c7cfc0dd0c984645f76. * 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.
5 years ago
  1. /* Copyright 2017 Yang Liu
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #ifndef RGBLIGHT_H
  17. #define RGBLIGHT_H
  18. #include "rgblight_reconfig.h"
  19. /***** rgblight_mode(mode)/rgblight_mode_noeeprom(mode) ****
  20. old mode number (before 0.6.117) to new mode name table
  21. |-----------------|-----------------------------------|
  22. | old mode number | new mode name |
  23. |-----------------|-----------------------------------|
  24. | 1 | RGBLIGHT_MODE_STATIC_LIGHT |
  25. | 2 | RGBLIGHT_MODE_BREATHING |
  26. | 3 | RGBLIGHT_MODE_BREATHING + 1 |
  27. | 4 | RGBLIGHT_MODE_BREATHING + 2 |
  28. | 5 | RGBLIGHT_MODE_BREATHING + 3 |
  29. | 6 | RGBLIGHT_MODE_RAINBOW_MOOD |
  30. | 7 | RGBLIGHT_MODE_RAINBOW_MOOD + 1 |
  31. | 8 | RGBLIGHT_MODE_RAINBOW_MOOD + 2 |
  32. | 9 | RGBLIGHT_MODE_RAINBOW_SWIRL |
  33. | 10 | RGBLIGHT_MODE_RAINBOW_SWIRL + 1 |
  34. | 11 | RGBLIGHT_MODE_RAINBOW_SWIRL + 2 |
  35. | 12 | RGBLIGHT_MODE_RAINBOW_SWIRL + 3 |
  36. | 13 | RGBLIGHT_MODE_RAINBOW_SWIRL + 4 |
  37. | 14 | RGBLIGHT_MODE_RAINBOW_SWIRL + 5 |
  38. | 15 | RGBLIGHT_MODE_SNAKE |
  39. | 16 | RGBLIGHT_MODE_SNAKE + 1 |
  40. | 17 | RGBLIGHT_MODE_SNAKE + 2 |
  41. | 18 | RGBLIGHT_MODE_SNAKE + 3 |
  42. | 19 | RGBLIGHT_MODE_SNAKE + 4 |
  43. | 20 | RGBLIGHT_MODE_SNAKE + 5 |
  44. | 21 | RGBLIGHT_MODE_KNIGHT |
  45. | 22 | RGBLIGHT_MODE_KNIGHT + 1 |
  46. | 23 | RGBLIGHT_MODE_KNIGHT + 2 |
  47. | 24 | RGBLIGHT_MODE_CHRISTMAS |
  48. | 25 | RGBLIGHT_MODE_STATIC_GRADIENT |
  49. | 26 | RGBLIGHT_MODE_STATIC_GRADIENT + 1 |
  50. | 27 | RGBLIGHT_MODE_STATIC_GRADIENT + 2 |
  51. | 28 | RGBLIGHT_MODE_STATIC_GRADIENT + 3 |
  52. | 29 | RGBLIGHT_MODE_STATIC_GRADIENT + 4 |
  53. | 30 | RGBLIGHT_MODE_STATIC_GRADIENT + 5 |
  54. | 31 | RGBLIGHT_MODE_STATIC_GRADIENT + 6 |
  55. | 32 | RGBLIGHT_MODE_STATIC_GRADIENT + 7 |
  56. | 33 | RGBLIGHT_MODE_STATIC_GRADIENT + 8 |
  57. | 34 | RGBLIGHT_MODE_STATIC_GRADIENT + 9 |
  58. | 35 | RGBLIGHT_MODE_RGB_TEST |
  59. | 36 | RGBLIGHT_MODE_ALTERNATING |
  60. |-----------------|-----------------------------------|
  61. *****/
  62. #define _RGBM_SINGLE_STATIC(sym) RGBLIGHT_MODE_##sym,
  63. #define _RGBM_SINGLE_DYNAMIC(sym) RGBLIGHT_MODE_##sym,
  64. #define _RGBM_MULTI_STATIC(sym) RGBLIGHT_MODE_##sym,
  65. #define _RGBM_MULTI_DYNAMIC(sym) RGBLIGHT_MODE_##sym,
  66. #define _RGBM_TMP_STATIC(sym, msym) RGBLIGHT_MODE_##sym,
  67. #define _RGBM_TMP_DYNAMIC(sym, msym) RGBLIGHT_MODE_##sym,
  68. enum RGBLIGHT_EFFECT_MODE {
  69. RGBLIGHT_MODE_zero = 0,
  70. #include "rgblight_modes.h"
  71. RGBLIGHT_MODE_last
  72. };
  73. #ifndef RGBLIGHT_H_DUMMY_DEFINE
  74. # define RGBLIGHT_MODES (RGBLIGHT_MODE_last - 1)
  75. // sample: #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85
  76. # ifndef RGBLIGHT_EFFECT_BREATHE_MAX
  77. # define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0-255
  78. # endif
  79. # ifndef RGBLIGHT_EFFECT_SNAKE_LENGTH
  80. # define RGBLIGHT_EFFECT_SNAKE_LENGTH 4
  81. # endif
  82. # ifndef RGBLIGHT_EFFECT_KNIGHT_LENGTH
  83. # define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3
  84. # endif
  85. # ifndef RGBLIGHT_EFFECT_KNIGHT_OFFSET
  86. # define RGBLIGHT_EFFECT_KNIGHT_OFFSET 0
  87. # endif
  88. # ifndef RGBLIGHT_EFFECT_KNIGHT_LED_NUM
  89. # define RGBLIGHT_EFFECT_KNIGHT_LED_NUM (effect_num_leds)
  90. # endif
  91. # ifndef RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL
  92. # define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 1000
  93. # endif
  94. # ifndef RGBLIGHT_EFFECT_CHRISTMAS_STEP
  95. # define RGBLIGHT_EFFECT_CHRISTMAS_STEP 2
  96. # endif
  97. # ifndef RGBLIGHT_HUE_STEP
  98. # define RGBLIGHT_HUE_STEP 8
  99. # endif
  100. # ifndef RGBLIGHT_SAT_STEP
  101. # define RGBLIGHT_SAT_STEP 17
  102. # endif
  103. # ifndef RGBLIGHT_VAL_STEP
  104. # define RGBLIGHT_VAL_STEP 17
  105. # endif
  106. # ifndef RGBLIGHT_LIMIT_VAL
  107. # define RGBLIGHT_LIMIT_VAL 255
  108. # endif
  109. # define RGBLED_TIMER_TOP F_CPU / (256 * 64)
  110. // #define RGBLED_TIMER_TOP 0xFF10
  111. # include <stdint.h>
  112. # include <stdbool.h>
  113. # include "eeconfig.h"
  114. # ifndef RGBLIGHT_CUSTOM_DRIVER
  115. # include "ws2812.h"
  116. # endif
  117. # include "color.h"
  118. # include "rgblight_list.h"
  119. # if defined(__AVR__)
  120. # include <avr/pgmspace.h>
  121. # endif
  122. extern LED_TYPE led[RGBLED_NUM];
  123. extern const uint8_t RGBLED_BREATHING_INTERVALS[4] PROGMEM;
  124. extern const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[3] PROGMEM;
  125. extern const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[3] PROGMEM;
  126. extern const uint8_t RGBLED_SNAKE_INTERVALS[3] PROGMEM;
  127. extern const uint8_t RGBLED_KNIGHT_INTERVALS[3] PROGMEM;
  128. extern const uint16_t RGBLED_RGBTEST_INTERVALS[1] PROGMEM;
  129. extern bool is_rgblight_initialized;
  130. // Should stay in sycn with rgb matrix config as we reuse eeprom storage for both (for now)
  131. typedef union {
  132. uint32_t raw;
  133. struct {
  134. bool enable : 1;
  135. uint8_t mode : 7;
  136. uint8_t hue : 8;
  137. uint8_t sat : 8;
  138. uint8_t val : 8;
  139. uint8_t speed : 8; // EECONFIG needs to be increased to support this
  140. };
  141. } rgblight_config_t;
  142. typedef struct _rgblight_status_t {
  143. uint8_t base_mode;
  144. bool timer_enabled;
  145. # ifdef RGBLIGHT_SPLIT
  146. uint8_t change_flags;
  147. # endif
  148. } rgblight_status_t;
  149. /* === Utility Functions ===*/
  150. void sethsv(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1);
  151. void sethsv_raw(uint8_t hue, uint8_t sat, uint8_t val, LED_TYPE *led1); // without RGBLIGHT_LIMIT_VAL check
  152. void setrgb(uint8_t r, uint8_t g, uint8_t b, LED_TYPE *led1);
  153. /* === Low level Functions === */
  154. void rgblight_set(void);
  155. void rgblight_set_clipping_range(uint8_t start_pos, uint8_t num_leds);
  156. /* === Effects and Animations Functions === */
  157. /* effect range setting */
  158. void rgblight_set_effect_range(uint8_t start_pos, uint8_t num_leds);
  159. /* direct operation */
  160. void rgblight_setrgb_at(uint8_t r, uint8_t g, uint8_t b, uint8_t index);
  161. void rgblight_sethsv_at(uint8_t hue, uint8_t sat, uint8_t val, uint8_t index);
  162. void rgblight_setrgb_range(uint8_t r, uint8_t g, uint8_t b, uint8_t start, uint8_t end);
  163. void rgblight_sethsv_range(uint8_t hue, uint8_t sat, uint8_t val, uint8_t start, uint8_t end);
  164. void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b);
  165. # ifndef RGBLIGHT_SPLIT
  166. void rgblight_setrgb_master(uint8_t r, uint8_t g, uint8_t b);
  167. void rgblight_setrgb_slave(uint8_t r, uint8_t g, uint8_t b);
  168. void rgblight_sethsv_master(uint8_t hue, uint8_t sat, uint8_t val);
  169. void rgblight_sethsv_slave(uint8_t hue, uint8_t sat, uint8_t val);
  170. # endif
  171. /* effect mode change */
  172. void rgblight_mode(uint8_t mode);
  173. void rgblight_mode_noeeprom(uint8_t mode);
  174. void rgblight_increase(void);
  175. void rgblight_decrease(void);
  176. void rgblight_step(void);
  177. void rgblight_step_noeeprom(void);
  178. void rgblight_step_reverse(void);
  179. void rgblight_step_reverse_noeeprom(void);
  180. /* effects mode disable/enable */
  181. void rgblight_toggle(void);
  182. void rgblight_toggle_noeeprom(void);
  183. void rgblight_enable(void);
  184. void rgblight_enable_noeeprom(void);
  185. void rgblight_disable(void);
  186. void rgblight_disable_noeeprom(void);
  187. /* hue, sat, val change */
  188. void rgblight_increase_hue(void);
  189. void rgblight_increase_hue_noeeprom(void);
  190. void rgblight_decrease_hue(void);
  191. void rgblight_decrease_hue_noeeprom(void);
  192. void rgblight_increase_sat(void);
  193. void rgblight_increase_sat_noeeprom(void);
  194. void rgblight_decrease_sat(void);
  195. void rgblight_decrease_sat_noeeprom(void);
  196. void rgblight_increase_val(void);
  197. void rgblight_increase_val_noeeprom(void);
  198. void rgblight_decrease_val(void);
  199. void rgblight_decrease_val_noeeprom(void);
  200. void rgblight_increase_speed(void);
  201. void rgblight_decrease_speed(void);
  202. void rgblight_sethsv(uint8_t hue, uint8_t sat, uint8_t val);
  203. void rgblight_sethsv_noeeprom(uint8_t hue, uint8_t sat, uint8_t val);
  204. /* query */
  205. uint8_t rgblight_get_mode(void);
  206. uint8_t rgblight_get_hue(void);
  207. uint8_t rgblight_get_sat(void);
  208. uint8_t rgblight_get_val(void);
  209. /* === qmk_firmware (core)internal Functions === */
  210. void rgblight_init(void);
  211. uint32_t rgblight_read_dword(void);
  212. void rgblight_update_dword(uint32_t dword);
  213. uint32_t eeconfig_read_rgblight(void);
  214. void eeconfig_update_rgblight(uint32_t val);
  215. void eeconfig_update_rgblight_default(void);
  216. void eeconfig_debug_rgblight(void);
  217. void rgb_matrix_increase(void);
  218. void rgb_matrix_decrease(void);
  219. void rgblight_sethsv_eeprom_helper(uint8_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom);
  220. void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom);
  221. # define EZ_RGB(val) rgblight_show_solid_color((val >> 16) & 0xFF, (val >> 8) & 0xFF, val & 0xFF)
  222. void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b);
  223. void rgblight_task(void);
  224. void rgblight_timer_init(void);
  225. void rgblight_timer_enable(void);
  226. void rgblight_timer_disable(void);
  227. void rgblight_timer_toggle(void);
  228. # ifdef RGBLIGHT_SPLIT
  229. # define RGBLIGHT_STATUS_CHANGE_MODE (1 << 0)
  230. # define RGBLIGHT_STATUS_CHANGE_HSVS (1 << 1)
  231. # define RGBLIGHT_STATUS_CHANGE_TIMER (1 << 2)
  232. # define RGBLIGHT_STATUS_ANIMATION_TICK (1 << 3)
  233. typedef struct _rgblight_syncinfo_t {
  234. rgblight_config_t config;
  235. rgblight_status_t status;
  236. } rgblight_syncinfo_t;
  237. /* for split keyboard master side */
  238. uint8_t rgblight_get_change_flags(void);
  239. void rgblight_clear_change_flags(void);
  240. void rgblight_get_syncinfo(rgblight_syncinfo_t *syncinfo);
  241. /* for split keyboard slave side */
  242. void rgblight_update_sync(rgblight_syncinfo_t *syncinfo, bool write_to_eeprom);
  243. # endif
  244. # ifdef RGBLIGHT_USE_TIMER
  245. typedef struct _animation_status_t {
  246. uint16_t last_timer;
  247. uint8_t delta; /* mode - base_mode */
  248. bool restart;
  249. union {
  250. uint16_t pos16;
  251. uint8_t pos;
  252. int8_t current_hue;
  253. uint16_t current_offset;
  254. };
  255. } animation_status_t;
  256. extern animation_status_t animation_status;
  257. void rgblight_effect_breathing(animation_status_t *anim);
  258. void rgblight_effect_rainbow_mood(animation_status_t *anim);
  259. void rgblight_effect_rainbow_swirl(animation_status_t *anim);
  260. void rgblight_effect_snake(animation_status_t *anim);
  261. void rgblight_effect_knight(animation_status_t *anim);
  262. void rgblight_effect_christmas(animation_status_t *anim);
  263. void rgblight_effect_rgbtest(animation_status_t *anim);
  264. void rgblight_effect_alternating(animation_status_t *anim);
  265. # endif
  266. #endif // #ifndef RGBLIGHT_H_DUMMY_DEFINE
  267. #endif // RGBLIGHT_H