aboutsummaryrefslogtreecommitdiff
path: root/keyboards/matrix/abelx/abelx.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/matrix/abelx/abelx.c')
-rw-r--r--keyboards/matrix/abelx/abelx.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/keyboards/matrix/abelx/abelx.c b/keyboards/matrix/abelx/abelx.c
index ee7ffde134..9058bf6e2f 100644
--- a/keyboards/matrix/abelx/abelx.c
+++ b/keyboards/matrix/abelx/abelx.c
@@ -41,20 +41,6 @@ uint8_t read_pin(uint16_t pin)
return (data & (1<<GET_PIN(pin))) ? 1 : 0;
}
-void matrix_init_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- aw9523b_init(AW9523B_ADDR);
-#endif
- matrix_init_user();
-}
-
-
-void housekeeping_task_kb(void) {
-#ifdef RGBLIGHT_ENABLE
- aw9523b_update_pwm_buffers(AW9523B_ADDR);
-#endif
-}
-
#ifdef RGBLIGHT_ENABLE
#include "rgblight.h"
#include "ws2812.h"
@@ -67,20 +53,35 @@ const aw9523b_led g_aw9523b_leds[AW9523B_RGB_NUM] = {
{AW9523B_P07_PWM, AW9523B_P06_PWM, AW9523B_P05_PWM},
};
-void setleds_custom(rgb_led_t *start_led, uint16_t num_leds)
-{
- uint8_t num = num_leds < AW9523B_RGB_NUM ? num_leds : AW9523B_RGB_NUM;
+void init_custom(void) {
+ aw9523b_init(AW9523B_ADDR);
+ ws2812_init();
+}
- ws2812_setleds(start_led, num);
+void set_color_custom(int index, uint8_t red, uint8_t green, uint8_t blue) {
+ if (index < AW9523B_RGB_NUM) {
+ aw9523b_set_color(index, red, green, blue);
+ } else {
+ ws2812_set_color(index - AW9523B_RGB_NUM, red, green, blue);
+ }
+}
- for (int i = 0; i < num; i++) {
- aw9523b_set_color(i, start_led[i].r, start_led[i].g, start_led[i].b);
+void set_color_all_custom(uint8_t red, uint8_t green, uint8_t blue) {
+ for (int i = 0; i < RGBLIGHT_LED_COUNT; i++) {
+ set_color_custom(i, red, green, blue);
}
}
+void flush_custom(void) {
+ aw9523b_update_pwm_buffers(AW9523B_ADDR);
+ ws2812_flush();
+}
+
const rgblight_driver_t rgblight_driver = {
- .init = ws2812_init,
- .setleds = setleds_custom,
+ .init = init_custom,
+ .set_color = set_color_custom,
+ .set_color_all = set_color_all_custom,
+ .flush = flush_custom,
};
#endif