diff options
| author | Drashna Jaelre <drashna@live.com> | 2020-10-04 13:05:26 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-04 13:05:26 -0700 |
| commit | c4f910b1b3b8b758093592d50c4c1b7c137b853f (patch) | |
| tree | d6d69ce93895e7fc7e4b039e4d809f84eb260df2 /quantum | |
| parent | edebe56f6b48084a7bbff6c494dd71c5620156b9 (diff) | |
| parent | ef7c79b781318faaef4e6fe318fffade1b1ed299 (diff) | |
| download | qmk_firmware-c4f910b1b3b8b758093592d50c4c1b7c137b853f.tar.gz qmk_firmware-c4f910b1b3b8b758093592d50c4c1b7c137b853f.zip | |
Merge pull request #10404 from cmdremily/opendeck-core
Allow the use of only one IS31FL3731 LED driver
Diffstat (limited to 'quantum')
| -rw-r--r-- | quantum/process_keycode/process_rgb.c | 4 | ||||
| -rw-r--r-- | quantum/rgb_matrix_drivers.c | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/quantum/process_keycode/process_rgb.c b/quantum/process_keycode/process_rgb.c index a1e46e034..d38af74f4 100644 --- a/quantum/process_keycode/process_rgb.c +++ b/quantum/process_keycode/process_rgb.c | |||
| @@ -23,6 +23,7 @@ typedef void (*rgb_func_pointer)(void); | |||
| 23 | * | 23 | * |
| 24 | * noinline to optimise for firmware size not speed (not in hot path) | 24 | * noinline to optimise for firmware size not speed (not in hot path) |
| 25 | */ | 25 | */ |
| 26 | #if !(defined(RGBLIGHT_DISABLE_KEYCODES) || defined(RGB_MATRIX_DISABLE_KEYCODES)) | ||
| 26 | static void __attribute__((noinline)) handleKeycodeRGB(const uint8_t is_shifted, const rgb_func_pointer inc_func, const rgb_func_pointer dec_func) { | 27 | static void __attribute__((noinline)) handleKeycodeRGB(const uint8_t is_shifted, const rgb_func_pointer inc_func, const rgb_func_pointer dec_func) { |
| 27 | if (is_shifted) { | 28 | if (is_shifted) { |
| 28 | dec_func(); | 29 | dec_func(); |
| @@ -30,6 +31,7 @@ static void __attribute__((noinline)) handleKeycodeRGB(const uint8_t is_shifted, | |||
| 30 | inc_func(); | 31 | inc_func(); |
| 31 | } | 32 | } |
| 32 | } | 33 | } |
| 34 | #endif | ||
| 33 | 35 | ||
| 34 | /** | 36 | /** |
| 35 | * Wrapper for animation mode | 37 | * Wrapper for animation mode |
| @@ -56,7 +58,9 @@ bool process_rgb(const uint16_t keycode, const keyrecord_t *record) { | |||
| 56 | // Split keyboards need to trigger on key-up for edge-case issue | 58 | // Split keyboards need to trigger on key-up for edge-case issue |
| 57 | if (!record->event.pressed) { | 59 | if (!record->event.pressed) { |
| 58 | #endif | 60 | #endif |
| 61 | #if !(defined(RGBLIGHT_DISABLE_KEYCODES) || defined(RGB_MATRIX_DISABLE_KEYCODES)) | ||
| 59 | uint8_t shifted = get_mods() & MOD_MASK_SHIFT; | 62 | uint8_t shifted = get_mods() & MOD_MASK_SHIFT; |
| 63 | #endif | ||
| 60 | switch (keycode) { | 64 | switch (keycode) { |
| 61 | case RGB_TOG: | 65 | case RGB_TOG: |
| 62 | #if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) | 66 | #if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES) |
diff --git a/quantum/rgb_matrix_drivers.c b/quantum/rgb_matrix_drivers.c index 0403d6c96..8f670f9a3 100644 --- a/quantum/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix_drivers.c | |||
| @@ -31,7 +31,9 @@ static void init(void) { | |||
| 31 | i2c_init(); | 31 | i2c_init(); |
| 32 | # ifdef IS31FL3731 | 32 | # ifdef IS31FL3731 |
| 33 | IS31FL3731_init(DRIVER_ADDR_1); | 33 | IS31FL3731_init(DRIVER_ADDR_1); |
| 34 | # ifdef DRIVER_ADDR_2 | ||
| 34 | IS31FL3731_init(DRIVER_ADDR_2); | 35 | IS31FL3731_init(DRIVER_ADDR_2); |
| 36 | # endif | ||
| 35 | # elif defined(IS31FL3733) | 37 | # elif defined(IS31FL3733) |
| 36 | IS31FL3733_init(DRIVER_ADDR_1, 0); | 38 | IS31FL3733_init(DRIVER_ADDR_1, 0); |
| 37 | # elif defined(IS31FL3737) | 39 | # elif defined(IS31FL3737) |
| @@ -55,7 +57,9 @@ static void init(void) { | |||
| 55 | // This actually updates the LED drivers | 57 | // This actually updates the LED drivers |
| 56 | # ifdef IS31FL3731 | 58 | # ifdef IS31FL3731 |
| 57 | IS31FL3731_update_led_control_registers(DRIVER_ADDR_1, 0); | 59 | IS31FL3731_update_led_control_registers(DRIVER_ADDR_1, 0); |
| 60 | # ifdef DRIVER_ADDR_2 | ||
| 58 | IS31FL3731_update_led_control_registers(DRIVER_ADDR_2, 1); | 61 | IS31FL3731_update_led_control_registers(DRIVER_ADDR_2, 1); |
| 62 | # endif | ||
| 59 | # elif defined(IS31FL3733) | 63 | # elif defined(IS31FL3733) |
| 60 | IS31FL3733_update_led_control_registers(DRIVER_ADDR_1, 0); | 64 | IS31FL3733_update_led_control_registers(DRIVER_ADDR_1, 0); |
| 61 | IS31FL3733_update_led_control_registers(DRIVER_ADDR_2, 1); | 65 | IS31FL3733_update_led_control_registers(DRIVER_ADDR_2, 1); |
| @@ -69,7 +73,9 @@ static void init(void) { | |||
| 69 | # ifdef IS31FL3731 | 73 | # ifdef IS31FL3731 |
| 70 | static void flush(void) { | 74 | static void flush(void) { |
| 71 | IS31FL3731_update_pwm_buffers(DRIVER_ADDR_1, 0); | 75 | IS31FL3731_update_pwm_buffers(DRIVER_ADDR_1, 0); |
| 76 | # ifdef DRIVER_ADDR_2 | ||
| 72 | IS31FL3731_update_pwm_buffers(DRIVER_ADDR_2, 1); | 77 | IS31FL3731_update_pwm_buffers(DRIVER_ADDR_2, 1); |
| 78 | # endif | ||
| 73 | } | 79 | } |
| 74 | 80 | ||
| 75 | const rgb_matrix_driver_t rgb_matrix_driver = { | 81 | const rgb_matrix_driver_t rgb_matrix_driver = { |
