diff options
| author | Jack Humbert <jack.humb@gmail.com> | 2019-04-08 19:57:43 -0400 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-04-08 16:57:43 -0700 |
| commit | fa4052c26e33b42b65521fd5ba9f94a3a778b275 (patch) | |
| tree | b16d69187656b109d98710359c9044edc716aaa2 /quantum/rgb_matrix_drivers.c | |
| parent | bc536b9b6d98e5428a28f6e6ba69675bd77b79cc (diff) | |
| download | qmk_firmware-fa4052c26e33b42b65521fd5ba9f94a3a778b275.tar.gz qmk_firmware-fa4052c26e33b42b65521fd5ba9f94a3a778b275.zip | |
Adds the Planck EZ, 3737 RGB, fixes out-of-tune notes (#5532)
* RGB Matrix overhaul
Breakout of animations to separate files
Integration of optimized int based math lib
Overhaul of rgb_matrix.c and animations for performance
* Updating effect function api for future extensions
* Combined the keypresses || keyreleases define checks into a single define so I stop forgetting it where necessary
* Moving define RGB_MATRIX_KEYREACTIVE_ENABLED earlier in the include chain
* Adds the Planck EZ, 3737 RGB, fixes out-of-tune notes
* fix bug in quantum/rgb_matrix_drivers.c
Co-Authored-By: jackhumbert <jack.humb@gmail.com>
* update command setting to the correct default
* correct rgb config
* remove commented-out lines
* update docs for the 3737
* Update docs/feature_rgb_matrix.md
Co-Authored-By: jackhumbert <jack.humb@gmail.com>
Diffstat (limited to 'quantum/rgb_matrix_drivers.c')
| -rw-r--r-- | quantum/rgb_matrix_drivers.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/quantum/rgb_matrix_drivers.c b/quantum/rgb_matrix_drivers.c index 70b80293d..3b7d58483 100644 --- a/quantum/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix_drivers.c | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | * be here if shared between boards. | 23 | * be here if shared between boards. |
| 24 | */ | 24 | */ |
| 25 | 25 | ||
| 26 | #if defined(IS31FL3731) || defined(IS31FL3733) | 26 | #if defined(IS31FL3731) || defined(IS31FL3733) || defined(IS31FL3737) |
| 27 | 27 | ||
| 28 | #include "i2c_master.h" | 28 | #include "i2c_master.h" |
| 29 | 29 | ||
| @@ -33,23 +33,29 @@ static void init( void ) | |||
| 33 | #ifdef IS31FL3731 | 33 | #ifdef IS31FL3731 |
| 34 | IS31FL3731_init( DRIVER_ADDR_1 ); | 34 | IS31FL3731_init( DRIVER_ADDR_1 ); |
| 35 | IS31FL3731_init( DRIVER_ADDR_2 ); | 35 | IS31FL3731_init( DRIVER_ADDR_2 ); |
| 36 | #else | 36 | #elif defined(IS31FL3733) |
| 37 | IS31FL3733_init( DRIVER_ADDR_1 ); | 37 | IS31FL3733_init( DRIVER_ADDR_1 ); |
| 38 | #else | ||
| 39 | IS31FL3737_init( DRIVER_ADDR_1 ); | ||
| 38 | #endif | 40 | #endif |
| 39 | for ( int index = 0; index < DRIVER_LED_TOTAL; index++ ) { | 41 | for ( int index = 0; index < DRIVER_LED_TOTAL; index++ ) { |
| 40 | bool enabled = true; | 42 | bool enabled = true; |
| 41 | // This only caches it for later | 43 | // This only caches it for later |
| 42 | #ifdef IS31FL3731 | 44 | #ifdef IS31FL3731 |
| 43 | IS31FL3731_set_led_control_register( index, enabled, enabled, enabled ); | 45 | IS31FL3731_set_led_control_register( index, enabled, enabled, enabled ); |
| 44 | #else | 46 | #elif defined(IS31FL3733) |
| 45 | IS31FL3733_set_led_control_register( index, enabled, enabled, enabled ); | 47 | IS31FL3733_set_led_control_register( index, enabled, enabled, enabled ); |
| 48 | #else | ||
| 49 | IS31FL3737_set_led_control_register( index, enabled, enabled, enabled ); | ||
| 46 | #endif | 50 | #endif |
| 47 | } | 51 | } |
| 48 | // This actually updates the LED drivers | 52 | // This actually updates the LED drivers |
| 49 | #ifdef IS31FL3731 | 53 | #ifdef IS31FL3731 |
| 50 | IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); | 54 | IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); |
| 51 | #else | 55 | #elif defined(IS31FL3733) |
| 52 | IS31FL3733_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); | 56 | IS31FL3733_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); |
| 57 | #else | ||
| 58 | IS31FL3737_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); | ||
| 53 | #endif | 59 | #endif |
| 54 | } | 60 | } |
| 55 | 61 | ||
| @@ -65,7 +71,7 @@ const rgb_matrix_driver_t rgb_matrix_driver = { | |||
| 65 | .set_color = IS31FL3731_set_color, | 71 | .set_color = IS31FL3731_set_color, |
| 66 | .set_color_all = IS31FL3731_set_color_all, | 72 | .set_color_all = IS31FL3731_set_color_all, |
| 67 | }; | 73 | }; |
| 68 | #else | 74 | #elif defined(IS31FL3733) |
| 69 | static void flush( void ) | 75 | static void flush( void ) |
| 70 | { | 76 | { |
| 71 | IS31FL3733_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); | 77 | IS31FL3733_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); |
| @@ -77,6 +83,18 @@ const rgb_matrix_driver_t rgb_matrix_driver = { | |||
| 77 | .set_color = IS31FL3733_set_color, | 83 | .set_color = IS31FL3733_set_color, |
| 78 | .set_color_all = IS31FL3733_set_color_all, | 84 | .set_color_all = IS31FL3733_set_color_all, |
| 79 | }; | 85 | }; |
| 86 | #else | ||
| 87 | static void flush( void ) | ||
| 88 | { | ||
| 89 | IS31FL3737_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); | ||
| 90 | } | ||
| 91 | |||
| 92 | const rgb_matrix_driver_t rgb_matrix_driver = { | ||
| 93 | .init = init, | ||
| 94 | .flush = flush, | ||
| 95 | .set_color = IS31FL3737_set_color, | ||
| 96 | .set_color_all = IS31FL3737_set_color_all, | ||
| 97 | }; | ||
| 80 | #endif | 98 | #endif |
| 81 | 99 | ||
| 82 | #endif | 100 | #endif |
