From f70f45ee677a2a39a759052a356e0c5d82e25424 Mon Sep 17 00:00:00 2001 From: James Laird-Wah Date: Fri, 28 Sep 2018 00:40:18 +1000 Subject: RGB Matrix refactoring to open up for new drivers (#3913) * rgb_matrix: use a driver ops struct This is intended to avoid #ifdef proliferation on adding more drivers, eg. model01, which use different architectures. * rgb_matrix: document driver struct members * rgb_matrix: remove unused LED testing code * rgb_matrix: don't build into IS31x drivers unless being used * rgb_matrix: refactor make config options This ensures that the necessary files are included for any custom RGB_MATRIX_ENABLE value, without having to add entries here for specific boards. This particularly affects model01 because its controller is integrated and won't be used anywhere else, so it's preferable not to put it in common_features.mk. This now validates the value of RGB_MATRIX_ENABLE. It was necessary to fix an error in ergodox_ez rules.mk using the wrong comment separator, yielding an invalid value. * IS31x drivers: don't write the control registers all the time This is only needed when they are changed. This is done in init() and board- or keymap-specific code is free to make further changes. * rgb_matrix: move structs from chip drivers to rgb_matrix_drivers.c This approach is specific to the rgb_matrix functionality, so keep it neatly separated from the raw chip drivers. --- drivers/issi/is31fl3731.c | 1 - drivers/issi/is31fl3733.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/issi') diff --git a/drivers/issi/is31fl3731.c b/drivers/issi/is31fl3731.c index 4d0d6b8a5e..c9155f5a37 100644 --- a/drivers/issi/is31fl3731.c +++ b/drivers/issi/is31fl3731.c @@ -268,4 +268,3 @@ void IS31FL3731_update_led_control_registers( uint8_t addr1, uint8_t addr2 ) } } } - diff --git a/drivers/issi/is31fl3733.c b/drivers/issi/is31fl3733.c index 4098b54689..c198ec5174 100644 --- a/drivers/issi/is31fl3733.c +++ b/drivers/issi/is31fl3733.c @@ -24,10 +24,10 @@ #include "wait.h" #endif -#include "is31fl3733.h" #include #include "i2c_master.h" #include "progmem.h" +#include "rgb_matrix.h" // This is a 7-bit address, that gets left-shifted and bit 0 // set to 0 for write, 1 for read (as per I2C protocol) @@ -250,4 +250,3 @@ void IS31FL3733_update_led_control_registers( uint8_t addr1, uint8_t addr2 ) } } } - -- cgit v1.2.3