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

Allow the use of only one IS31FL3731 LED driver #10404

Merged
merged 2 commits into from
Oct 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions quantum/process_keycode/process_rgb.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ typedef void (*rgb_func_pointer)(void);
*
* noinline to optimise for firmware size not speed (not in hot path)
*/
#if !(defined(RGBLIGHT_DISABLE_KEYCODES) || defined(RGB_MATRIX_DISABLE_KEYCODES))
static void __attribute__((noinline)) handleKeycodeRGB(const uint8_t is_shifted, const rgb_func_pointer inc_func, const rgb_func_pointer dec_func) {
if (is_shifted) {
dec_func();
} else {
inc_func();
}
}
#endif

/**
* Wrapper for animation mode
Expand All @@ -56,7 +58,9 @@ bool process_rgb(const uint16_t keycode, const keyrecord_t *record) {
// Split keyboards need to trigger on key-up for edge-case issue
if (!record->event.pressed) {
#endif
#if !(defined(RGBLIGHT_DISABLE_KEYCODES) || defined(RGB_MATRIX_DISABLE_KEYCODES))
uint8_t shifted = get_mods() & MOD_MASK_SHIFT;
#endif
switch (keycode) {
case RGB_TOG:
#if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_DISABLE_KEYCODES)
Expand Down
6 changes: 6 additions & 0 deletions quantum/rgb_matrix_drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ static void init(void) {
i2c_init();
# ifdef IS31FL3731
IS31FL3731_init(DRIVER_ADDR_1);
# ifdef DRIVER_ADDR_2
IS31FL3731_init(DRIVER_ADDR_2);
# endif
# elif defined(IS31FL3733)
IS31FL3733_init(DRIVER_ADDR_1, 0);
# elif defined(IS31FL3737)
Expand All @@ -55,7 +57,9 @@ static void init(void) {
// This actually updates the LED drivers
# ifdef IS31FL3731
IS31FL3731_update_led_control_registers(DRIVER_ADDR_1, 0);
# ifdef DRIVER_ADDR_2
IS31FL3731_update_led_control_registers(DRIVER_ADDR_2, 1);
# endif
# elif defined(IS31FL3733)
IS31FL3733_update_led_control_registers(DRIVER_ADDR_1, 0);
IS31FL3733_update_led_control_registers(DRIVER_ADDR_2, 1);
Expand All @@ -69,7 +73,9 @@ static void init(void) {
# ifdef IS31FL3731
static void flush(void) {
IS31FL3731_update_pwm_buffers(DRIVER_ADDR_1, 0);
# ifdef DRIVER_ADDR_2
IS31FL3731_update_pwm_buffers(DRIVER_ADDR_2, 1);
# endif
}

const rgb_matrix_driver_t rgb_matrix_driver = {
Expand Down