summaryrefslogtreecommitdiff
path: root/keyboards/dp60
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2023-12-05 22:49:14 +1100
committerGitHub <noreply@github.com>2023-12-05 22:49:14 +1100
commit17f36a21bfc340e4715c5849e4d0c537820e7cbe (patch)
tree88a9604026cd94de52eaa34f6a93e2e8d975659e /keyboards/dp60
parent2acb426b8e51acd4ba16475c2132023cbb59b71a (diff)
Rework RGBLight driver system (#22529)
Diffstat (limited to 'keyboards/dp60')
-rw-r--r--keyboards/dp60/keymaps/indicator/indicator.c12
-rw-r--r--keyboards/dp60/keymaps/indicator/rules.mk2
2 files changed, 9 insertions, 5 deletions
diff --git a/keyboards/dp60/keymaps/indicator/indicator.c b/keyboards/dp60/keymaps/indicator/indicator.c
index 02450ce68d..d7b628cc56 100644
--- a/keyboards/dp60/keymaps/indicator/indicator.c
+++ b/keyboards/dp60/keymaps/indicator/indicator.c
@@ -14,10 +14,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "dp60.h"
-
-#include "rgblight.h"
-
+#include QMK_KEYBOARD_H
+#include "ws2812.h"
// caps led
const rgblight_segment_t PROGMEM dp60_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
@@ -72,13 +70,17 @@ extern rgblight_config_t rgblight_config;
extern void rgblight_layers_write(void);
extern void indicator_write(rgb_led_t *start_led, uint8_t num_leds);
-void rgblight_call_driver(rgb_led_t *start_led, uint8_t num_leds)
+void setleds_custom(rgb_led_t *start_led, uint16_t num_leds)
{
ws2812_setleds(start_led, RGBLED_NUM-RGB_INDICATOR_NUM);
indicator_write(start_led + (RGBLED_NUM - RGB_INDICATOR_NUM), RGB_INDICATOR_NUM);
}
+const rgblight_driver_t rgblight_driver = {
+ .setleds = setleds_custom,
+};
+
void led_update_ports(led_t led_state) {
rgblight_set_layer_state(0, led_state.caps_lock);
rgblight_set_layer_state(1, led_state.scroll_lock);
diff --git a/keyboards/dp60/keymaps/indicator/rules.mk b/keyboards/dp60/keymaps/indicator/rules.mk
index a8891659f7..853666e4f4 100644
--- a/keyboards/dp60/keymaps/indicator/rules.mk
+++ b/keyboards/dp60/keymaps/indicator/rules.mk
@@ -1,4 +1,6 @@
RGBLIGHT_ENABLE = yes # Use RGB underglow light
+RGBLIGHT_DRIVER = custom
+WS2812_DRIVER_REQUIRED = yes
SRC += indicator.c led_driver.c