summaryrefslogtreecommitdiff
path: root/keyboards/ergodox_ez/led_i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/ergodox_ez/led_i2c.c')
-rw-r--r--keyboards/ergodox_ez/led_i2c.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/keyboards/ergodox_ez/led_i2c.c b/keyboards/ergodox_ez/led_i2c.c
index 23ef91b74f..a8802858ec 100644
--- a/keyboards/ergodox_ez/led_i2c.c
+++ b/keyboards/ergodox_ez/led_i2c.c
@@ -21,8 +21,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef RGBLIGHT_ENABLE
# include "ergodox_ez.h"
+# include "ws2812.h"
-void rgblight_call_driver(rgb_led_t *led, uint8_t led_num) {
+void setleds_custom(rgb_led_t *led, uint16_t led_num) {
i2c_init();
i2c_start(0x84, ERGODOX_EZ_I2C_TIMEOUT);
int i = 0;
@@ -30,7 +31,7 @@ void rgblight_call_driver(rgb_led_t *led, uint8_t led_num) {
// prevent right-half code from trying to bitbang all 30
// so with 30 LEDs, we count from 29 to 15 here, and the
// other half does 0 to 14.
- uint8_t half_led_num = RGBLED_NUM / 2;
+ uint8_t half_led_num = RGBLIGHT_LED_COUNT / 2;
for (i = half_led_num + half_led_num - 1; i >= half_led_num; --i)
# elif defined(ERGODOX_LED_15_MIRROR)
for (i = 0; i < led_num; ++i)
@@ -51,5 +52,8 @@ void rgblight_call_driver(rgb_led_t *led, uint8_t led_num) {
ws2812_setleds(led, led_num);
}
+const rgblight_driver_t rgblight_driver = {
+ .setleds = setleds_custom,
+};
#endif // RGBLIGHT_ENABLE