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 | |
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')
-rw-r--r-- | quantum/audio/audio_arm.c | 6 | ||||
-rw-r--r-- | quantum/rgb_matrix.h | 4 | ||||
-rw-r--r-- | quantum/rgb_matrix_drivers.c | 28 | ||||
-rw-r--r-- | quantum/stm32/halconf.h | 2 | ||||
-rw-r--r-- | quantum/stm32/mcuconf.h | 2 |
5 files changed, 31 insertions, 11 deletions
diff --git a/quantum/audio/audio_arm.c b/quantum/audio/audio_arm.c index 6760015ef..de0cd15c5 100644 --- a/quantum/audio/audio_arm.c +++ b/quantum/audio/audio_arm.c | |||
@@ -79,7 +79,7 @@ float startup_song[][2] = STARTUP_SONG; | |||
79 | 79 | ||
80 | static void gpt_cb8(GPTDriver *gptp); | 80 | static void gpt_cb8(GPTDriver *gptp); |
81 | 81 | ||
82 | #define DAC_BUFFER_SIZE 720 | 82 | #define DAC_BUFFER_SIZE 100 |
83 | #ifndef DAC_SAMPLE_MAX | 83 | #ifndef DAC_SAMPLE_MAX |
84 | #define DAC_SAMPLE_MAX 65535U | 84 | #define DAC_SAMPLE_MAX 65535U |
85 | #endif | 85 | #endif |
@@ -98,8 +98,8 @@ static void gpt_cb8(GPTDriver *gptp); | |||
98 | RESTART_CHANNEL_1() | 98 | RESTART_CHANNEL_1() |
99 | #define UPDATE_CHANNEL_2_FREQ(freq) gpt7cfg1.frequency = freq * DAC_BUFFER_SIZE; \ | 99 | #define UPDATE_CHANNEL_2_FREQ(freq) gpt7cfg1.frequency = freq * DAC_BUFFER_SIZE; \ |
100 | RESTART_CHANNEL_2() | 100 | RESTART_CHANNEL_2() |
101 | #define GET_CHANNEL_1_FREQ gpt6cfg1.frequency | 101 | #define GET_CHANNEL_1_FREQ (uint16_t)(gpt6cfg1.frequency * DAC_BUFFER_SIZE) |
102 | #define GET_CHANNEL_2_FREQ gpt7cfg1.frequency | 102 | #define GET_CHANNEL_2_FREQ (uint16_t)(gpt7cfg1.frequency * DAC_BUFFER_SIZE) |
103 | 103 | ||
104 | 104 | ||
105 | /* | 105 | /* |
diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index 855ea0323..0e193dcb2 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h | |||
@@ -28,7 +28,9 @@ | |||
28 | #ifdef IS31FL3731 | 28 | #ifdef IS31FL3731 |
29 | #include "is31fl3731.h" | 29 | #include "is31fl3731.h" |
30 | #elif defined (IS31FL3733) | 30 | #elif defined (IS31FL3733) |
31 | #include "is31fl3733.h" | 31 | #include "is31fl3733.h" |
32 | #elif defined (IS31FL3737) | ||
33 | #include "is31fl3737.h" | ||
32 | #endif | 34 | #endif |
33 | 35 | ||
34 | #ifndef RGB_MATRIX_LED_FLUSH_LIMIT | 36 | #ifndef RGB_MATRIX_LED_FLUSH_LIMIT |
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 |
diff --git a/quantum/stm32/halconf.h b/quantum/stm32/halconf.h index 8fe8e0c6f..c3e0cbb72 100644 --- a/quantum/stm32/halconf.h +++ b/quantum/stm32/halconf.h | |||
@@ -76,7 +76,7 @@ | |||
76 | * @brief Enables the I2C subsystem. | 76 | * @brief Enables the I2C subsystem. |
77 | */ | 77 | */ |
78 | #if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) | 78 | #if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) |
79 | #define HAL_USE_I2C FALSE | 79 | #define HAL_USE_I2C TRUE |
80 | #endif | 80 | #endif |
81 | 81 | ||
82 | /** | 82 | /** |
diff --git a/quantum/stm32/mcuconf.h b/quantum/stm32/mcuconf.h index 7c3c6e570..36f8ca225 100644 --- a/quantum/stm32/mcuconf.h +++ b/quantum/stm32/mcuconf.h | |||
@@ -154,7 +154,7 @@ | |||
154 | /* | 154 | /* |
155 | * I2C driver system settings. | 155 | * I2C driver system settings. |
156 | */ | 156 | */ |
157 | #define STM32_I2C_USE_I2C1 FALSE | 157 | #define STM32_I2C_USE_I2C1 TRUE |
158 | #define STM32_I2C_USE_I2C2 FALSE | 158 | #define STM32_I2C_USE_I2C2 FALSE |
159 | #define STM32_I2C_BUSY_TIMEOUT 50 | 159 | #define STM32_I2C_BUSY_TIMEOUT 50 |
160 | #define STM32_I2C_I2C1_IRQ_PRIORITY 10 | 160 | #define STM32_I2C_I2C1_IRQ_PRIORITY 10 |